Package Exports
- polyfill-number-tolocalestring
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (polyfill-number-tolocalestring) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
polyfill-number-tolocalestring
Polyfill Number.prototype.toLocaleString() with globalize and cldr-data.
install
$ yarn add polyfill-number-tolocalestringusage
import usePolyfill from 'polyfill-number-tolocalestring'
async function main() {
const reset = await usePolyfill(true)
const num = 1200.01
console.log(num.toLocaleString('nl')) // -> 1.200,01
console.log(num.toLocaleString('nl', {
style: 'currency',
currency: 'EUR',
currencyDisplay: 'code'
})) // -> 1.200,01 EUR
reset()
console.log(num.toLocaleString('nl')) // -> 1,200.01
}
main()