v8/test/intl/number-format/check-minimum-fraction-digits.js
hichris123 ddb5c2d999 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}
2015-07-17 15:08:08 +00:00

10 lines
356 B
JavaScript
Executable File

// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Make sure minimumFractionDigits is honored
var nf = new Intl.NumberFormat("en-us",{ useGrouping: false, minimumFractionDigits: 4});
assertEquals("12345.6789", nf.format(12345.6789));