diff options
Diffstat (limited to 'js/src/tests/test262/intl402/ch11/11.3/11.3.2_TRP.js')
-rw-r--r-- | js/src/tests/test262/intl402/ch11/11.3/11.3.2_TRP.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/ch11/11.3/11.3.2_TRP.js b/js/src/tests/test262/intl402/ch11/11.3/11.3.2_TRP.js new file mode 100644 index 000000000..9ab6550b6 --- /dev/null +++ b/js/src/tests/test262/intl402/ch11/11.3/11.3.2_TRP.js @@ -0,0 +1,56 @@ +// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the digits are determined correctly when specifying significant digits. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +var locales = [ + new Intl.NumberFormat().resolvedOptions().locale, + "ar", "de", "th", "ja" +]; +var numberingSystems = [ + "arab", + "latn", + "thai", + "hanidec" +]; +var testData = { + "0": "0.00", + "-0": "0.00", + "123": "123", + "-123": "-123", + "12345": "12345", + "-12345": "-12345", + "123.45": "123.45", + "-123.45": "-123.45", + "123.44499": "123.44", + "-123.44499": "-123.44", + "123.44500": "123.45", + "-123.44500": "-123.45", + "123.44501": "123.45", + "-123.44501": "-123.45", + "0.001234": "0.001234", + "-0.001234": "-0.001234", + "0.00000000123": "0.00000000123", + "-0.00000000123": "-0.00000000123", + "0.00000000000000000000000000000123": "0.00000000000000000000000000000123", + "-0.00000000000000000000000000000123": "-0.00000000000000000000000000000123", + "1.2": "1.20", + "-1.2": "-1.20", + "0.0000000012344501": "0.0000000012345", + "-0.0000000012344501": "-0.0000000012345", + "123445.01": "123450", + "-123445.01": "-123450", + "12344501000000000000000000000000000": "12345000000000000000000000000000000", + "-12344501000000000000000000000000000": "-12345000000000000000000000000000000" +}; + +testNumberFormat(locales, numberingSystems, + {useGrouping: false, minimumSignificantDigits: 3, maximumSignificantDigits: 5}, + testData); + |