My current project uses a
double data type for its values and i have raised a suggestion to convert it to
decimal data type instead. I remember that it is recommended to use decimal over double for financial applications because decimal data types have greater significant digits compared to
floating points. Floating point types is composed of
float and
double data types for c#.
decimal: 28-29 significant digits
float: 7 digits
double: 15-16 digits
[EDIT]
Even if your application reached million in data representation, you're not safe if you use float since a million contains 7 whole number digits plus the possible 2 digits for the decimal, a total of 9 significant digits. You'll end up with rounded off data which is problematic for financial apps. Note that you should also use the correct data type in your data store (money for SQL server).
Posted
09-07-2006 1:39 PM
by
jokiz