Skip to content

Agent: format numbers for the selected language #1558

Open

Description

@AnthonyRonning

Maple Work formats every number the English way, whatever language is selected. Spanish and German therefore show 984,534 where readers expect 984.534, and the same holds for prices and compact counts.

Seen while reviewing #1514, where the extra credit balance became prominent in the Settings menu ("Extra credits · 984,534 left"). It is not specific to that row.

Where

  • apps/maple-agent/app/src/billing.rs: format_count always groups with ,.
  • apps/maple-agent/app/src/ui/settings/usage/model.rs: fmt_count, fmt_compact and fmt_price do the same for the Usage page, with . as the decimal mark.
  • Callers pass the finished string into Fluent as text, so the catalog cannot format it either.
  • Translator comments give English examples such as "984,534" and "20,000", and the Spanish catalog hardcodes 1,000 créditos while the German one writes 1.000 Punkte.

Wanted

One number formatter that takes the active locale (grouping separator, decimal mark, compact suffixes, currency placement) and is used for counts, compact counts, percentages and prices across the app. Dates already go through localized presentation; numbers should follow.

Minor: nothing is wrong in English, and the values are still readable in other languages.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions