Reputation: 643
Which type to use (float or double) for handling currency/money? At the moment I am using float for handling currency/money. I searched through the net, but found nothing. I know this is a question that includes debate which is not allowed, but I need some explanation for me to decide.
Thanks
Upvotes: 0
Views: 1067
Reputation: 34581
All numbers in JavaScript are 64-bit floating point numbers, i.e. double.
See the following links for more information:
http://www.hunlock.com/blogs/The_Complete_Javascript_Number_Reference
http://www.crockford.com/javascript/survey.html
You don't have a choice in regard to the way your numbers are stored.
Upvotes: 0
Reputation: 7887
There is only one type of number in javascript. So you don't really have a choice.
Upvotes: 1