Skip to content

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

@ikala-retso-huang

Description

@ikala-retso-huang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy