This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 215
NumberFormat.formatToParts() #149
Merged
caridy
merged 12 commits into
andyearnshaw:master
from
stasm:NumberFormat.formatToParts
Feb 29, 2016
Merged
NumberFormat.formatToParts() #149
caridy
merged 12 commits into
andyearnshaw:master
from
stasm:NumberFormat.formatToParts
Feb 29, 2016
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> require('./index').NumberFormat('en-IN', {useGrouping: false}).formatToParts(123456.01) [ { type: 'value', name: 'integer', value: '123456' }, { type: 'token', name: 'decimalSeparator', value: '.' }, { type: 'value', name: 'fraction', value: '01' } ]
> require('./index').NumberFormat('pl', {useGrouping: false}).formatToParts(-123456.01) [ { type: 'token', name: '???', value: '-' }, { type: 'value', name: 'integer', value: '123456' }, { type: 'token', name: 'decimalSeparator', value: ',' }, { type: 'value', name: 'fraction', value: '01' } ] > require('./index').NumberFormat('pl', {useGrouping: false, style: 'percent'}).formatToParts(-123456.123) [ { type: 'token', name: '???', value: '-' }, { type: 'value', name: 'integer', value: '12345612' }, { type: 'token', name: '???', value: '%' } ]
> require('./index').NumberFormat('en-IN').formatToParts(-123456.123) [ { type: 'token', name: '???', value: '-' }, { type: 'value', name: 'group', value: '1' }, { type: 'token', name: 'groupSeparator', value: ',' }, { type: 'value', name: 'group', value: '23' }, { type: 'token', name: 'groupSeparator', value: ',' }, { type: 'value', name: 'group', value: '456' }, { type: 'token', name: 'decimalSeparator', value: '.' }, { type: 'value', name: 'fraction', value: '123' } ] > require('./index').NumberFormat('pl').formatToParts(-123456.123) [ { type: 'token', name: '???', value: '-' }, { type: 'value', name: 'group', value: '123' }, { type: 'token', name: 'groupSeparator', value: ' ' }, { type: 'value', name: 'group', value: '456' }, { type: 'token', name: 'decimalSeparator', value: ',' }, { type: 'value', name: 'fraction', value: '123' } ]
actually, you know what, can you revert the update the CLDR data, the last commit, so we can see the actual code changes without the interference of the cldr data? |
Sure, let me do it right now. |
This reverts commit 00b8739.
caridy
added a commit
that referenced
this pull request
Feb 29, 2016
caridy
added a commit
that referenced
this pull request
Feb 29, 2016
I have merged this as part of the big refactor of the code, there are still issues with the sign replacements. e.g.:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP for tc39/ecma402#79. It's missing comments which I'll add once the ECMA 402 PR is reviewed.