Skip to content

[BUG] formatAmount() utility doesn't respect the caller's locale for decimal/thousands separators #799

Open

Description

@meshackyaro

Description

formatAmount(amount, { locale: 'de-DE' }) is documented to support locale-aware formatting, but the implementation always uses US-style formatting (. for decimals, , for thousands) regardless of the locale option passed.

Component

utils

Steps to Reproduce

  1. Call formatAmount('1234.56', { locale: 'de-DE' }).
  2. Compare the result against the expected German-locale format (1.234,56).
  3. Confirm the locale option has no observable effect.

Expected Behavior

The function should actually use Intl.NumberFormat (or equivalent) with the provided locale, producing correctly localized output.

Actual Behavior

The locale option is accepted but silently ignored; output is always US-formatted regardless of what's passed.

Environment

  • SDK version: 0.3.x
  • Node version: 20.x, 22.x
  • OS: macOS / Linux
  • Network: TESTNET

Code Example

formatAmount('1234.56', { locale: 'de-DE' }); // '1,234.56' instead of '1.234,56'

Error Output

N/A — no thrown error; behavior is incorrect but silent.

Difficulty

🟢 Easy

Additional Context

The formatting implementation uses manual string manipulation instead of Intl.NumberFormat, and never reads the locale option.

Activity

  1. added
    bug
    good first issue
    difficulty: easy
    priority: low
    on Oct 29, 2026
  2. Ranjeet2063 commented on Oct 29, 2026

    @Ranjeet2063

    Hi there,

    I can take on this frontend improvement. I'll address formatAmount utility doesn't respect the caller's locale for decimal/thousands separators cleanly, avoid unnecessary re-renders, and ensure responsive state handling. Could you assign this to me? I can have a PR ready shortly.

    Cheers,

  3. GangDev6707 commented on Nov 6, 2026

    @GangDev6707

    Hi folks,

    I reviewed the issue for formatAmount() utility doesn't respect the caller's locale for decimal/thousands separators. The documentation has discrepancies with the current codebase regarding formatamount() utility doesn't respect the caller's locale for decimal/thousands separators.

    Proposed Implementation:

    1. Audit the source definitions and identify the exact missing methods, types, or deprecation notices.
    2. Update the documentation files with accurate code signatures, examples, and migration guides.
    3. Verify that all markdown anchors, cross-links, and formatting render cleanly without lint warnings.

    Testing & Verification:
    I will run the documentation / markdown linter and verify all code snippets compile against the current API.

    Ready to implement the patch today once assigned. Thanks!

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

    bugdifficulty: easygood first issuepriority: lowsdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions