Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Intl.NumberFormat.format*() supports value argument as number, bigint or string. Corresponding methods in intl-numberformat and its consumers, only support number.

Support for string unlocks formatting high-precision values that would lose precision if converted to number. Also, string argument is well-supported across browsers.

I know we want to stay in compliance with the spec so looking at the relevant parts (e.g. format):

  1. Let value be ? ToNumber(value).

and "ToNumber" does prescribe handling for string:

  1. If argument is a String, return StringToNumber(argument).

Which implies that "value" can be string.

Should this be supported in this library? I am not sure if this lack of support is intentional or not. If not, please convert this to an issue.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.