It's also safe to return decimal values for displaying values.
It's also safe to return decimal values for displaying values.
https://hackage-content.haskell.org/package/base-4.22.0.0/do...
Its a wrapper around an `Integer` where you declare the scale in the type. So if you use `Fixed E2` as your type then `MkFixed 1` is 1 cent. If you did `Fixed E3` as your type then `MkFixed 1` is 0.1 cent. In both cases it is entirely an integer encoding.
If you're doing static payments or displaying a number, it doesn't matter if it's float amounts or integer cents since you're not doing any calculations anyway.
Stripe uses cents mostly because it's the most foolproof way that won't cause massive issues as a public API.
You could argue that a price is not really an amount that anyone can actually pay and that's true. But it seems complex and error prone to store unit prices and amounts using different scaling factors.