Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSRangeErrorException setting maximumFractionDigits to 0 with Intl.NumberFormat currency style #1236

Closed
1 task done
jdconley opened this issue Jan 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jdconley
Copy link

jdconley commented Jan 5, 2024

Bug Description

An exception occurs when attempting to create a currency formatter with no fraction digits.

This was identified in #990 but closed due to the report using a wrapper.

  • I have run gradle clean and confirmed this bug does not occur with JSC

Hermes version: 0.72.6
React Native version (if any): 0.72.6
OS version (if any): Android API 34
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): arm64-v8a (Emulator and Google Pixel 8)

No exception on iOS. Functions as expected.

Steps To Reproduce

  1. Device locale set to en-US
  2. Create a currency style formatter with maximumFractionDigits set to 0

code example:

    new Intl.NumberFormat(undefined, {
      style: 'currency',
      currency: 'USD',
      maximumFractionDigits: 0
    });

The Expected Behavior

No exception, and a formatter that outputs a string without fraction digits.

@jdconley jdconley added the bug Something isn't working label Jan 5, 2024
@dannysu
Copy link
Contributor

dannysu commented Jan 10, 2024

Landed a fix with #1246

@dannysu dannysu closed this as completed Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants