Skip to content

fix(currency): format amounts by locale convention instead of one har… - #66

Merged
Renekakpo merged 1 commit into
developfrom
fix/locale-aware-currency-formatting
Aug 20, 2026
Merged

fix(currency): format amounts by locale convention instead of one har…#66
Renekakpo merged 1 commit into
developfrom
fix/locale-aware-currency-formatting

Conversation

@Renekakpo

Copy link
Copy Markdown
Contributor

…dcoded shape

Why:

  • The app rendered "CFA60,000" where French convention writes "60 000 FCFA". In French the comma is the decimal separator, so a French reader saw that string and read sixty. Four defects came from the same hand-written template: the XOF symbol token, a hardcoded prefix, no gap before the symbol, and a grouping comma pinned through toLocaleString('en-US'). The factory default separator was never derived from the device either, so the app displayed one convention and expected input in another.

What:

  • A single profile table carries the four rules per convention, and adds the French one: space grouping, comma decimal, suffixed symbol. The parser derives its separators from that same table so the two cannot drift, and learns the three grouping spaces on a branch that returns before the decimal tie-break, so a space can never be read as a decimal point. The profile is derived from the device locale on first launch only; a stored choice always wins, and an install predating the field keeps the static default rather than being restyled by an update. Intl was rejected: its output depends on the host ICU, it renders XOF as "F CFA", and it cannot honour the user's separator setting.

…dcoded shape

Why:
- The app rendered "CFA60,000" where French convention writes "60 000 FCFA". In
  French the comma is the decimal separator, so a French reader saw that string
  and read sixty. Four defects came from the same hand-written template: the XOF
  symbol token, a hardcoded prefix, no gap before the symbol, and a grouping
  comma pinned through toLocaleString('en-US'). The factory default separator was
  never derived from the device either, so the app displayed one convention and
  expected input in another.

What:
- A single profile table carries the four rules per convention, and adds the
  French one: space grouping, comma decimal, suffixed symbol. The parser derives
  its separators from that same table so the two cannot drift, and learns the
  three grouping spaces on a branch that returns before the decimal tie-break,
  so a space can never be read as a decimal point. The profile is derived from
  the device locale on first launch only; a stored choice always wins, and an
  install predating the field keeps the static default rather than being
  restyled by an update. Intl was rejected: its output depends on the host ICU,
  it renders XOF as "F CFA", and it cannot honour the user's separator setting.
@Renekakpo
Renekakpo merged commit f755c20 into develop Aug 20, 2026
1 check passed
@Renekakpo
Renekakpo deleted the fix/locale-aware-currency-formatting branch August 20, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant