js/src/tests/test262/intl402/ch11/11.3/11.3.2_TRP.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 // Copyright 2011-2012 Norbert Lindenberg. All rights reserved.
     2 // Copyright 2012 Mozilla Corporation. All rights reserved.
     3 // This code is governed by the BSD license found in the LICENSE file.
     5 /**
     6  * @description Tests that the digits are determined correctly when specifying significant digits.
     7  * @author Norbert Lindenberg
     8  */
    10 $INCLUDE("testIntl.js");
    12 var locales = [
    13     new Intl.NumberFormat().resolvedOptions().locale,
    14     "ar", "de", "th", "ja"
    15 ];
    16 var numberingSystems = [
    17     "arab",
    18     "latn",
    19     "thai",
    20     "hanidec"
    21 ];
    22 var testData = {
    23     "0": "0.00",
    24     "-0": "0.00",
    25     "123": "123",
    26     "-123": "-123",
    27     "12345": "12345",
    28     "-12345": "-12345",
    29     "123.45": "123.45",
    30     "-123.45": "-123.45",
    31     "123.44499": "123.44",
    32     "-123.44499": "-123.44",
    33     "123.44500": "123.45",
    34     "-123.44500": "-123.45",
    35     "123.44501": "123.45",
    36     "-123.44501": "-123.45",
    37     "0.001234": "0.001234",
    38     "-0.001234": "-0.001234",
    39     "0.00000000123": "0.00000000123",
    40     "-0.00000000123": "-0.00000000123",
    41     "0.00000000000000000000000000000123": "0.00000000000000000000000000000123",
    42     "-0.00000000000000000000000000000123": "-0.00000000000000000000000000000123",
    43     "1.2": "1.20",
    44     "-1.2": "-1.20",
    45     "0.0000000012344501": "0.0000000012345",
    46     "-0.0000000012344501": "-0.0000000012345",
    47     "123445.01": "123450",
    48     "-123445.01": "-123450",
    49     "12344501000000000000000000000000000": "12345000000000000000000000000000000",
    50     "-12344501000000000000000000000000000": "-12345000000000000000000000000000000"
    51 };
    53 testNumberFormat(locales, numberingSystems,
    54     {useGrouping: false, minimumSignificantDigits: 3, maximumSignificantDigits: 5},
    55     testData);

mercurial