Skip to content

@formatjs/intl-numberformat return wrong result when number greater than 1000T #4236

@vipycm

Description

@vipycm

Which package?

@formatjs/intl-numberformat

Describe the bug

return wrong result when number greater than 1000T

To Reproduce

Codesandbox URL

https://codesandbox.io/s/javascript-forked-w7qq2g?file=/src/index.js

Reproducible Steps/Repo

Steps to reproduce the behavior:

  1. options: {notation: "compact"}
  2. format a number greater than 1000T

Expected behavior

const formater = new NumberFormat("en", {
notation: "compact",
compactDisplay: "short",
maximumFractionDigits: 2,
minimumFractionDigits: 0,
})
console.log(formater.format(1.75682e15))
except: 1,756.82.T
actual: 17.57

Screenshots

image

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