3 ms·
If you're the one settling the books at your bank, sure. If you just need to display the price of something, a float+money formatter is mostly fine.
by saagarjha 3y ago
If you're the one settling the books at your bank, sure. If you just need to display the price of something, a float+money formatter is mostly fine.
- ddtaylor 3y agoMostly. You might be surprised how much of a headache it creates when things are off by a little in ways customers don't understand even when you're not settling transactions like that. Customers get confused when they get receipts or invoices where things don't add up, even when it saves them a penny! I've seen rounding down make people mad because it didn't add up when discounts were applied even when they were the benefit of the extra cent. Obviously rounding up makes people mad out of principle because it's adding cost that wasn't agreed upon.
- Affric 3y agoI have left another comment. A trillion times this. Floats anywhere give two outcomes: customer accuses you of salami slicing from them or you give away millions.
- ben_w 3y agoEvery so often, someone shares a picture where NaN got printed onto a price sticker.