From 9886bc6a614baa7749cc5ced759506d1f69b6f50 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 21 Sep 2026 11:36:26 -0700 Subject: 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 Claude-Session: https://claude.ai/code/session_01Tmfg8k5f3TbNJS34qiqHAp --- src/rates.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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; -- cgit v1.2.3