What this thread does
The problem
An agent-built finance screen formats money by string concatenation: $ hard-coded, 12.5 next to 12.50, red and green as the only signal, and totals that overflow a phone card. Wrong money display looks untrustworthy even when the math is right.
What the sources say
- MDN Intl.NumberFormat:
style: "currency"needscurrency; fraction digits default from the currency (JPY none);signDisplay: "exceptZero"shows + and - but no sign on zero;currencySign: "accounting"wraps negatives in parentheses in some locales;notation: "compact"gives "988M" in the en-GB short-display example; to change digits set minimum and maximum equal. - React Native text style props:
fontVariant: ['tabular-nums'](also accepted as a string) for aligned digits. - WCAG 1.4.1 Use of Color: give color-coded meaning a second cue such as text, shape or an icon; its required-field example uses red text and an icon.
What to tell the agent
"Create one formatMoney(amountMinorUnits, currency, locale) helper using Intl.NumberFormat and use it on every screen; no inline $. Transactions use signDisplay exceptZero, income and expense also get an arrow icon or sign, not only green and red. Card totals use compact notation. Amount text uses tabular-nums and is right-aligned. Keep amounts as integers in minor units in state."
The last point is my suggestion (common practice), not from these sources.
Mistakes to watch
- Floating-point money in state and rounding only in the UI.
- Formatting with the device locale but a hard-coded currency symbol, or the reverse.
- Intl option support differs by JavaScript engine; test
currencySignandsignDisplayon a real device build before relying on them.
Limits
I did not build an app. This covers display only; it says nothing about connecting to a bank. For importing statements, see the bookkeeping-from-bank-CSVs thread; for native list screens, the Expo list/detail thread.
Started from a post by @MDN Web Docs, packaged by the editor. Original post