logoalt Hacker News

fragmedeyesterday at 7:57 PM1 replyview on HN

"Monetary value must be stored in integers" is the much stronger statement that the article doesn't make. Obviously there are exceptions, but you're going to need a much longer side discussion in order to justify why you're using floats.

It's like saying "don't write your own crypto algorithm". Of course write your own crypto algorithm, that's how you learn about cryptography. But you'd never put your homegrown cryptographic algorithm into production until after several PhDs worth of understanding of cryptography has been put into it by many other people.


Replies

Eremtoday at 1:49 AM

If you render a number using JavaScript it has been temporarily stored as a doublr. The article was likely allowing for that common use case.