Skip to content

fix(web): guard price axis fraction digits - #8055

Open
ayaanoncrypto wants to merge 1 commit into
Uniswap:mainfrom
ayaanoncrypto:fix/8054-safe-fraction-digits
Open

fix(web): guard price axis fraction digits#8055
ayaanoncrypto wants to merge 1 commit into
Uniswap:mainfrom
ayaanoncrypto:fix/8054-safe-fraction-digits

Conversation

@ayaanoncrypto

Copy link
Copy Markdown

Fixes #8054

Summary

The price-axis formatter passed unvalidated decimals values into both minimumFractionDigits and maximumFractionDigits. A malformed or out-of-range precision value causes Intl.NumberFormat to throw RangeError: maximumFractionDigits value is out of range.

This change validates that the precision is an integer from 0 through the Intl-supported maximum of 100. Invalid values use the existing standard fiat formatter instead of constructing an invalid formatter. Regression coverage verifies valid fixed-precision formatting and the fallback path for precision above the limit.

Testing

  • node /tmp/uniswap-8054-intl-smoke.js
    • git show --check HEAD
    • The focused Vitest command could not run in the sandbox because the repository dependency tree was unavailable and package installation stopped with ERR_PNPM_ENOSPC. CI should run the full repository checks.

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.

[Bug] maximumFractionDigits value is out of range

1 participant