What is the best data type to use for currency

Hi guys,
What is the best data type to use for currency. I ask this because currently I am using 'Single' data type however it often gives me 15.4999999, etc. so I have to keep rounding that to 2 decimal places and formatting. That seems so inefficient, especially if there is significant amount of computation being done.

Any suggestions?

/Michael
gem56Asked:
Who is Participating?
 
SethiCommented:
You can always use the Format function to curtail the numer of digits you want to see after the decimanl like this:
Dim decNumber as Decimal
decNumber = 15.4999999
decNumber.ToString.Format("#,###.00")
0
 
SethiCommented:
Decimal.
0
 
Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
the documentation recommends to use the Decimal Type
0
 
gem56Author Commented:
Tanks for that guys.

I considered using Decimal type but thought in light of its size (8 bytes) that Single was more efficient to use (4 bytes). I'll try Decimal type but it seems I can't get away from using Round and Format functions. It's OK for now but in future if I need to do more repetitive computation I may feel different.

/Michael
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.