tc39 / proposal-intl-formatToParts

Intl 402 spec proposal for {DateTimeFormat,Number}.prototype.formatToParts
17 stars 17 forks source link

Polyfill for Intl.NumberFormat.prototype.formatToParts #4

Open chicoxyzzy opened 6 years ago

chicoxyzzy commented 6 years ago

Current polyfill contains only Intl.DateTimeFormat.prototype.formatToParts but not Intl.NumberFormat.prototype.formatToParts

JSONRice commented 5 years ago

@chicoxyzzy I concur. There is no Intl.NumberFormat.prototype.formatToParts Did you find something to cover that? I really could use a polyfill for this. @littledan do you have a polyfill for the NumberFormat?

littledan commented 5 years ago

I don't have one. Contributions would be welcome.

Magenta94 commented 3 years ago

Any updates on this?

rvetere commented 3 years ago

seems like "formatjs" has a polyfill for "Intl.NumberFormat"... maybe it would be possible to re-use this one somehow..? https://formatjs.io/docs/polyfills/intl-numberformat/

m-nathani commented 3 years ago

please update the readme to remove Intl.NumberFormat.prototype.formatToParts if thats not polyfilled yet.

i got an error on my application that formaTtoParts is not defined

TypeError: Intl.NumberFormat(t,{minimumFractionDigits:2}).formatToParts is not a function. (In 'Intl.NumberFormat(t,{minimumFractionDigits:2}).formatToParts(ri(e))', 'Intl.NumberFormat(t,{minimumFractionDigits:2}).formatToParts' is undefined)
browser.name:
Mobile Safari UI/WKWebView

device:
iPhone

interface_type:
exception

os:
iOS 12.5.5

Is it possible to find a polyfill please for alternate solution that supports previous version of Safar from 13 ???