Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
bartman
· 16y ago · 0 comments
Having 1 item with a price tag of $10.50 will display a total of $10.5. I'd have expected $10.50 :)
Comments
[–]
tyweir
16y ago
Further, 21 items that cost $55.1 total $1157.1000000000001
[–]
jfarmer
16y ago
Do not, do not, do not use floating-point arithmetic for money.
[–]
jrockway
16y ago
Further, the validation for the price field lets you type in prices like "1.2.3.4", which is confusingly invalid.
Who needs tests when you have HN!
[–]
tyweir
16y ago
Maybe you expect payment in IP addresses.
[–]
ataggart
16y ago
fp math + money = Superman III
[–]
pistoriusp
16y ago
Oh, thanks.