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

Currency-derived fractional digit count defaults are inappropriately applied with scientific/engineering/etc. notation #912

Open
gibson042 opened this issue Jul 18, 2024 · 2 comments · May be fixed by #925
Labels
c: numbers Component: numbers, currency, units s: discuss Status: TG2 must discuss to move forward

Comments

@gibson042
Copy link
Contributor

(originally posted by @gibson042 in #839 (comment) )

We arguably have a bug where currency-derived fractional digit count defaults are applied even when the decimal point is moved away from its absolute position, as in new Intl.NumberFormat("en", { style: "currency", currency, currencyDisplay: "code", notation: "engineering" }).format(12345).replace(/^.*\s/, "") resulting in "12E3" for JPY but "12.35E3" for USD).

Put another way, I think I expect currency-derived precision and corresponding rounding to apply only when notation is "standard" (i.e., not even when the decimal point happens to be in the right place with scientific/engineering/compact notation).

@gibson042 gibson042 changed the title Currency-derived fractional digit count defaults are inappropriately applied with non-"standard" notation Currency-derived fractional digit count defaults are inappropriately applied with non-"standard" notation Jul 18, 2024
@gibson042 gibson042 changed the title Currency-derived fractional digit count defaults are inappropriately applied with non-"standard" notation Currency-derived fractional digit count defaults are inappropriately applied with scientific/engineering/etc. notation Jul 18, 2024
@ray007
Copy link

ray007 commented Jul 19, 2024

Currency formatting with engineering notation, is that a real-world issue?

@sffc
Copy link
Contributor

sffc commented Aug 22, 2024

I would support a PR tweaking this behavior.

@sffc sffc added s: discuss Status: TG2 must discuss to move forward c: numbers Component: numbers, currency, units labels Aug 22, 2024
ben-allen added a commit to ben-allen/ecma402 that referenced this issue Sep 17, 2024
…er of fractional units used to display that currency when using standard notation.

Previously this data was inappropriately used when using scientific, engineering, and compact notations. See issue tc39#912.
ben-allen added a commit to ben-allen/ecma402 that referenced this issue Sep 17, 2024
…er of minor units used to display that currency when using standard notation.

Previously this data was inappropriately used to set the number of fractional digits displayed when formatting currency values in scientific, engineering, and compact notations. See issue tc39#912.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: numbers Component: numbers, currency, units s: discuss Status: TG2 must discuss to move forward
Projects
Status: Other Issues
3 participants