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. ?
allquestAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

credoCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CminusminusCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.