-
Notifications
You must be signed in to change notification settings - Fork 107
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
Clarification on behavior of SetNumberFormatDigitOptions #244
Comments
The logic surrounding these options is rearranged/cleaned up in https://github.com/sffc/proposal-unified-intl-numberformat . I'd suggest that, if we make further normative changes, we do it within that proposal. Actually, @sffc's currently proposed spec text may actually do what you are suggesting. |
I believe it does (the internal properties for integer/fraction are set exclusively from sigfigs). We can close this if you want, or leave it open for another issue that shane's proposal fixes -- I don't mind either way. |
Let's get confirmation from @sffc and close it if he agrees that the proposal settles the issue. |
My new proposal adds a new internal field (which is not exposed publicly) called Screenshot of my draft spec (copy-paste is too hard to preserve formatting): I will list this issue as one of the ones being addressed by my proposal. |
Awesome, closing this issue in that case. |
Currently, https://tc39.github.io/ecma402/#sec-setnfdigitoptions sets the internal slots for fraction and integer digits in all cases, and only sets the significant digits conditionally. As a result, when calling resolvedOptions on either NumberFormat or PluralRules instances with these options set, only fraction/integer digits are reported when provided/in the default case, but significant digits are reported in addition when provided. Since significant digits override fraction/integer digits and significant digits are not included in the default case or in the case where the user provides only fraction/integer, shouldn't fraction/integer not be present when the user provides significant digits?
So, current state:
I feel like the following makes more sense considering the actual behavior or format/select:
Also, on a much smaller note -- since SetNumberFormatDigitOptions is used by PluralRules, shouldn't it be an Intl abstract operation, rather than a NumberFormat abstract operation?
The text was updated successfully, but these errors were encountered: