2

I am using Intl library of native Javascript to show formatted number in English and Chinese.
It is working properly in Chrome, but it is not working in IE11.

For English locale following is the code and output:

new Intl.NumberFormat('en-GB', { notation: "compact" , compactDisplay: "short" }).format(91005);

Expected output: 91K
Output Getting in Chrome: 91K
Output Getting in IE11: 91,005 ---> Incorrect Output

Similarly for Chinese locale following is the code and output:

new Intl.NumberFormat('zh-cn', { notation: "compact" , compactDisplay: "short" }).format(91005);

Expected Output: 9.1万
Output Getting Chrome: 9.1万
Output Getting in IE11: 91,005 --> Incorrect Output

Need help on this to solve this issue ?

user1441238
  • 165
  • 1
  • 2
  • 10

1 Answers1

1

IE11 has an old version of Intl.NumberFormat so u need to polyfill using this: https://formatjs.io/docs/polyfills/intl-numberformat

Long Ho
  • 599
  • 4
  • 15