diff options
| author | Adam Soltys <[email protected]> | 2026-09-21 11:36:26 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-21 11:36:26 -0700 |
| commit | 9886bc6a614baa7749cc5ced759506d1f69b6f50 (patch) | |
| tree | d2a8238320768e4ebc178fff495c5341f2b4d423 /src | |
| parent | 91b50248982c81412bf2c750e9604c68b1ac5b1d (diff) | |
| download | coinosv3-9886bc6a614baa7749cc5ced759506d1f69b6f50.tar.gz coinosv3-9886bc6a614baa7749cc5ced759506d1f69b6f50.zip | |
Fiat reads to the cent everywhere.
Amounts under one unit used to get four decimals; two now, like any price.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Tmfg8k5f3TbNJS34qiqHAp
Diffstat (limited to 'src')
| -rw-r--r-- | src/rates.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rates.js b/src/rates.js index 19b3512..517caa3 100644 --- a/src/rates.js +++ b/src/rates.js @@ -134,6 +134,6 @@ export function fmtFiatBare(sats, rate) { const v = (Number(sats) / 100_000_000) * rate; return v.toLocaleString(undefined, { maximumFractionDigits: fiatDigits(v), minimumFractionDigits: 2 }); } -// Under a unit of currency, sats are small: a tenth of a cent still deserves -// to be a number rather than 0.00. -const fiatDigits = (v) => (Math.abs(v) < 1 && v !== 0 ? 4 : 2); +// Money reads to the cent. A tenth of a cent used to get four decimals so a +// few sats weren't 0.00, but "0.4998" next to a till was noise, not precision. +const fiatDigits = () => 2; |
