@formatjs/intl-numberformat
Version:
Ponyfill for ES2020 Intl.NumberFormat
10 lines (9 loc) • 418 B
JavaScript
import { NumberFormat } from './src/core';
import { toLocaleString as _toLocaleString } from './src/to_locale_string';
import { defineProperty } from '@formatjs/ecma402-abstract';
defineProperty(Intl, 'NumberFormat', { value: NumberFormat });
defineProperty(Number.prototype, 'toLocaleString', {
value: function toLocaleString(locales, options) {
return _toLocaleString(this, locales, options);
},
});