rdmurphy/journalize

Migrate intcomma to Intl.NumberFormat

rdmurphy opened this issue · 2 comments

I think it'd be good to rid this function of the regex that figures out where to place commas and migrate to the Intl.NumberFormat API.

This in theory would create a path for adding light localization to journalize without requiring a massive dependency.

Not that extensive IE 11 compatibility has ever been a goal of this library but browser support is surprisingly good.

image

Bummer — this may not be a valid option if we expect to support Node.js < v13, and may not be full-proof until Node v12 leaves LTS!

Node began releasing builds with full-icu support in v13, which means unless you explicitly did the same for any versions below that you won't get what you'd expect with Intl.NumberFormat. I use nodenv and the v10 and v12 builds I have on hand didn't come with full ICU support out of the box, so probably safe to assume most folks wouldn't either.

Not gonna lie didn't expect Node to be the blocker here. 🤔