Scenario:
When the customer prompts that the stock is insufficient, the customer can check the stock quantity with the naked eye.
However, scheduling tracking finds "Incredible" exceptions.
Simple analysis:
1. It's okay to convert to decimal for calculation. Data is not lost because of its high precision and different storage methods.
2. Data loss in double mode. The highest accuracy. Data overflow occurs after binary conversion, resulting in data loss.
3. The default value of C # is double, which indicates data loss.
Summary:
After reading several posts, C # introduces the decimal type to support finance and currency computing. Therefore, decimal is used directly in the future when processing financial and other data.
Reference:
Http://bbs.csdn.net/topics/70318335
Http://www.cnblogs.com/jhxk/articles/1605755.html
Http://www.cnblogs.com/haiyang1985/archive/2009/03/03/1402394.html
Http://blog.csdn.net/lai123wei/article/details/7220276 read this post to understand the cause of my problem.