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

[NumberFormat] Set always to useGrouping does not work when the notation is compact #4476

Closed
ikala-retso-huang opened this issue Jul 14, 2024 · 0 comments

Comments

@ikala-retso-huang
Copy link

Which package?

  • "@formatjs/intl-numberformat": "^8.10.3"

Describe the bug

The format number polyfill doesn't accept useGrouping as always when the notation is compact.

To Reproduce

Codesandbox URL

https://codesandbox.io/p/devbox/epic-sun-jmty2q?embed=1&file=%2Findex.ts

Expected behavior

import "@formatjs/intl-numberformat/polyfill-force";
import "@formatjs/intl-numberformat/locale-data/zh-Hant";

const formatter = new Intl.NumberFormat("zh-Hant", {
  notation: "compact",
  useGrouping: "always",
});

console.log(formatter.format(1000)); // expected 1,000 but get 1000

Desktop

  • Node: v18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants