"100.00" or "1000.50". Representing money as
strings avoids the rounding errors that come with floating-point numbers.
Working with amounts
- Send and receive amounts as strings:
"100.00", not100or100.0. - Parse them with a decimal or big-number type, never a native float. Summing or comparing floats can silently lose cents.
- Every fiat amount comes with a currency alongside it.
Currencies
Fiat amounts use ISO 4217 currency codes. Spritz currently works withUSD, CAD,
EUR, and GBP. See What we support for the rails and regions
behind each.