Currency

  • Thread starter Thread starter Smokey Grindel
  • Start date Start date
S

Smokey Grindel

What is a good data type to store 4 digit precision currency in VB.NET?
Double? Since it is only 4 digit precision wouldnt have any rounding
problems right? thanks!
 
Smokey Grindel said:
What is a good data type to store 4 digit precision currency in VB.NET?
Double? Since it is only 4 digit precision wouldnt have any rounding
problems right?

Take a look at th 'Decimal' type. 4 digit precision can still be a problem
when performing calculations using 'Double' and then rounding the result.
 
Smokey Grindel said:
What is a good data type to store 4 digit precision currency in VB.NET?
Double? Since it is only 4 digit precision wouldnt have any rounding
problems right? thanks!


All numeric types potentially have rounding problems when it comes to
divison. A single gives you 7 significant figures, a double 15, and a
Decimal 29. If you only require 4 sig fig, I would be inclined to use
Double
 
Back
Top