# what is the different between single and currency

How should I know when I should use single or currency ?

Dim a as single
dim b as currency

if a and b are used for to display dollar sign, then I have to
use format\$(a or b,"currency"). So is there any different if I used
both a and b. ?
###### Who is Participating?

Commented:
The major difference between the two types are the size of the number that is storable as well as the accuracy when making calculations.

SINGLE:   32bit (4-byte)
CURRENCY: 64bit (8-byte)

As you can see, Currency occupies twice as much space as Single.  This does however mean that you can store larger values in Currency.

SINGLE:-3.402823E38 to -1.401298E-45 for negative values, and 1.401298E-45 to 3.402823E38 for positive values.

CURRENCY:-922,337,203,685,477.5808 to 922,337,203,685,477.5807

The conclusion is, if you are going to make monetary or fixed-point calculations and require a high level of accuracy then Microsoft suggests the use of the Currency data type.
0

Commented:
Ok, a guy walks into a bar and order 21 shots of tequila then he goes home. He returns to the bar the next day and the bartender says "Hey wernt you that guy who order 21 shots of tequila". The man responded "why yes". The bartender asked "Well what hapend when you went home?". The man said "I blew chunks". The bartender said "Well of course after 21 shots of tequila". The man said "You dont understand chunks is my dog".
0