Home | History | Annotate | Download | only in format
      1 #######################################################################
      2 # Copyright (C) 2016 and later: Unicode, Inc. and others.
      3 # License & terms of use: http://www.unicode.org/copyright.html#License
      4 #######################################################################
      5 #######################################################################
      6 # Copyright (c) 2004, 2012 International Business Machines
      7 # Corporation and others.  All Rights Reserved.
      8 #######################################################################
      9 # Author: Alan Liu
     10 # Created: March 15 2004
     11 # Since: ICU 3.0
     12 ######################################################################
     13 
     14 ref= "#.#"
     15 
     16 rt:  "0.###"  1.0         "1"         
     17 
     18 # Basics
     19 fp:  "0.####" 0.10005     "0.1"        0.1
     20 fp:  -        0.10006     "0.1001"     0.1001
     21 pat: -        "#0.####"
     22 fp:  "#.####" 0.10005     "0.1"        0.1
     23 pat: -        "#0.####"
     24 
     25 rt:  "0"      1234        "1234"
     26 pat: -        "#0"
     27 
     28 # Significant digits                                                  
     29 fp:  "@@@"    1.234567    "1.23"       1.23
     30 fp:  -        1234567     "1230000"    1230000
     31 fp:  -        0.012345    "0.0123"     0.0123
     32 pat: -        -                                    
     33 fp:  "#,@@@"  1234567     "1,230,000"  1230000
     34 pat: -        "#,@@@"
     35 rt:  "@@@@"   0.0012      "0.001200"  
     36 fp:  -        0.99999     "1.000"      1
     37 pat: -        -
     38 rt:  "@###"   0.00123     "0.00123"   
     39 rt:  -        123000      "123000"    
     40 fp:  -        123456      "123500"     123500
     41 fp:  -        12.3456     "12.35"      12.35
     42 fp:  -        0.0123456   "0.01235"    0.01235
     43 pat: -        -
     44 fp:  "@,###"  27182       "27,180"     27180
     45 rt:  -        123000      "123,000"   
     46 fp:  -        0.99999     "1"          1
     47 rt:  -        0.9999      "0.9999"    
     48 pat: -        -
     49 rt:  "@##E0"  20000       "2E4"
     50 rt:  -        27000       "2.7E4"     
     51 rt:  -        27100       "2.71E4"
     52 fp:  -        27182       "2.72E4"     27200
     53 pat: -        -
     54 rt:  "@@@E0"  20000       "2.00E4"
     55 rt:  -        27000       "2.70E4"    
     56 rt:  -        27100       "2.71E4"
     57 fp:  -        27182       "2.72E4"     27200
     58 pat: -        -
     59 fp:  "#,@@##" 314156      "31,4200"    314200
     60 rt:  -        3           "3.0"       
     61 rt:  -        5000        "5000"      
     62 rt:  -        0.005       "0.0050"    
     63 pat: -        -
     64 fp:  "@@@@@@" 123456.7    "123457"     123457
     65 pat: -        -
     66 
     67 pat: "##,@@##" "#,@@##"
     68 pat: "##@@##"  "@@##"
     69 
     70 pat: "@@.@@"  err  # decimal sep. disallowed in sig. digits
     71 pat: "@#@"    err  # only one cluster of sig. digits
     72 pat: "@@0"    err  # either @ or 0, not both
     73 
     74 # NumberRegression/Test4140009
     75 rt:  ""       123.456     "123.456"
     76 rt:  ""       -123.456    "-123.456"
     77 
     78 # Currency
     79 fpc: "en_US"        1234.56/USD  "$1,234.56"    1234.56/USD
     80 fpc: -              1234.56/JPY  "1,235"  1235/JPY
     81 # ISO codes that overlap display names (QQQ vs. Q)
     82 # fake ISO code is not longer supported
     83 # fpc: -              123/QQQ      "QQQ123.00"    123/QQQ   # QQQ is fake
     84 fpc: -              123/GTQ      "GTQ123.00"      123/GTQ
     85 # ChoiceFormat-based display names
     86 fpc: -              1/INR        "1.00"      1/INR
     87 
     88 fpc: -              2/INR        "2.00"      2/INR
     89 # Display names with shared prefix (YDD vs. Y)
     90 fpc: -              100/YDD      "YDD100.00"    100/YDD
     91 fpc: -              100/CNY      "CN100.00"      100/CNY
     92 
     93 # Lenient Tests
     94 
     95 loc= "en"
     96 p: -              "1,234.56" 1234.56
     97 p: -              "1'234.56" 1234.56
     98 p: -              "1 234.56" 1234.56
     99 p: -              "1234.56" 1234.56
    100 p: -              "123456" 1234.56
    101 p: -              "1.234.56" 1.234
    102 p: -              "123456" 1234.56
    103 
    104 loc= "fr"
    105 p: -              "1.234,56" 1234.56
    106 p: -              "1'234,56" 1234.56
    107 p: -              "1 234,56" 1234.56
    108 p: -              "1,234,56" 1.234
    109 p: -              "123456" 1234.56
    110 
    111 loc= "ar"
    112 p: -              "123456" 1234.56
    113 p: -              "123456" 1234.56
    114 p: -              "123456" 1234.56
    115 p: -              "1234,56" 1234.56
    116 p: -              "1234,56" 1234.56
    117 p: -              "1234,56" 1234.56
    118 
    119 strict= true
    120 loc= "en"
    121 p: -              "123456" 1
    122 loc= "fr"
    123 p: -              "123456" 1
    124 loc= "ar"
    125 p: -              "123456" 1234
    126 p: -              "123456" 1234
    127