Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: backport Intl.NumberFormat fix #6275

Closed
wants to merge 2 commits into from

Conversation

targos
Copy link
Member

@targos targos commented Apr 19, 2016

  • tests and code linting passes
  • the commit message follows commit guidelines
Description of change

Backport two V8 fixes to Intl to fix issues in Intl.NumberFormat.
Fixes: #6260

cc @srl295 @nodejs/lts

Original commit message:

    Make NumberFormat use the ICU currency data, fix bug in NumberFormat

    NumberFormat previously just used a min of 0 digits after the decimal and a max of 3. This CL changes it so that we use the ICU currency data, and set the min and max to the number of numbers after the decimal point for each currency.

    This CL also fixes a small bug where if the minimum fraction digits is above 3 but the maximum fraction digits isn't set, then it returns with only three numbers after the decimal point.

    BUG=435465,473104,304722
    LOG=Y

    Review URL: https://codereview.chromium.org/1231613006

    Cr-Commit-Position: refs/heads/master@{nodejs#29734}
Original commit message:

    Fix user options for fractional digits in Intl.NumberFormatter

    The patch in https://crrev.com/ddb5c2d999c5ee6e31c4a9599bb3ddb293cc3f49
    moved all fractional digit settings to default values due to a coding
    error. These were not even correct default values, and users observed
    errors where percentages were written as "23.0%" instead of "23%".

    This patch fixes the setting propagation when appropriate and it changes
    the default max fractional digits of a percentage to 0, per spec.

    BUG=chromium:544122
    R=mnita,jochen
    CC=hichris123,adamk
    LOG=Y

    Review URL: https://codereview.chromium.org/1420883002

    Cr-Commit-Position: refs/heads/master@{nodejs#31468}
@targos targos added v8 engine Issues and PRs related to the V8 dependency. lts-watch-v4.x labels Apr 19, 2016
@targos targos added the i18n-api Issues and PRs related to the i18n implementation. label Apr 19, 2016
@targos
Copy link
Member Author

targos commented Apr 19, 2016

@bnoordhuis
Copy link
Member

Can't these be cherry-picked upstream into the 5.0 release branch?

@targos
Copy link
Member Author

targos commented Apr 19, 2016

They already are in the 5.0 branch (it even goes back to 4.6). This is a backport for LTS only.

@bnoordhuis
Copy link
Member

Apologies, missed that the target branch was v4.x-staging. LGTM.

@mhdawson has been working on making the V8 test suite run on our CI but I'm not sure if v4.x is already included. If it is, it would be good to run this PR through it.

@jasnell
Copy link
Member

jasnell commented Apr 20, 2016

Well, even with the V8 tests it might be worthwhile adding a quick regression test in test\parallel just to be overly cautious. Either way, LGTM

jasnell pushed a commit that referenced this pull request Apr 20, 2016
Original commit message:

    Make NumberFormat use the ICU currency data, fix bug in NumberFormat

    NumberFormat previously just used a min of 0 digits after the decimal and a max of 3. This CL changes it so that we use the ICU currency data, and set the min and max to the number of numbers after the decimal point for each currency.

    This CL also fixes a small bug where if the minimum fraction digits is above 3 but the maximum fraction digits isn't set, then it returns with only three numbers after the decimal point.

    BUG=435465,473104,304722
    LOG=Y

    Review URL: https://codereview.chromium.org/1231613006

    Cr-Commit-Position: refs/heads/master@{#29734}

PR-URL: #6275
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell pushed a commit that referenced this pull request Apr 20, 2016
Original commit message:

    Fix user options for fractional digits in Intl.NumberFormatter

    The patch in https://crrev.com/ddb5c2d999c5ee6e31c4a9599bb3ddb293cc3f49
    moved all fractional digit settings to default values due to a coding
    error. These were not even correct default values, and users observed
    errors where percentages were written as "23.0%" instead of "23%".

    This patch fixes the setting propagation when appropriate and it changes
    the default max fractional digits of a percentage to 0, per spec.

    BUG=chromium:544122
    R=mnita,jochen
    CC=hichris123,adamk
    LOG=Y

    Review URL: https://codereview.chromium.org/1420883002

    Cr-Commit-Position: refs/heads/master@{#31468}

PR-URL: #6275
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Apr 20, 2016

Landed in 43b2292 and 213ab35. We can add the regression test later in a separate PR :-)

@jasnell jasnell closed this Apr 20, 2016
@targos targos deleted the fix-6260 branch April 20, 2016 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-api Issues and PRs related to the i18n implementation. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants