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 # The new pattern parser treats this the same as "@@#"
     72 #pat: "@#@"    err  # only one cluster of sig. digits
     73 pat: "@@0"    err  # either @ or 0, not both
     74 
     75 # NumberRegression/Test4140009
     76 rt:  ""       123.456     "123.456"
     77 rt:  ""       -123.456    "-123.456"
     78 
     79 # Currency
     80 fpc: "en_US"        1234.56/USD  "$1,234.56"    1234.56/USD
     81 fpc: -              1234.56/JPY  "1,235"  1235/JPY
     82 # ISO codes that overlap display names (QQQ vs. Q)
     83 # fake ISO code is not longer supported
     84 # fpc: -              123/QQQ      "QQQ123.00"    123/QQQ   # QQQ is fake
     85 fpc: -              123/GTQ      "GTQ123.00"     123/GTQ
     86 # ChoiceFormat-based display names
     87 fpc: -              1/INR        "1.00"      1/INR
     88 
     89 fpc: -              2/INR        "2.00"      2/INR
     90 # Display names with shared prefix (YDD vs. Y)
     91 fpc: -              100/YDD      "YDD100.00"     100/YDD
     92 fpc: -              100/CNY      "CN100.00"      100/CNY
     93 
     94 # Lenient Tests
     95 
     96 loc= "en"
     97 p: -              "1,234.56" 1234.56
     98 p: -              "1'234.56" 1234.56
     99 p: -              "1 234.56" 1234.56
    100 p: -              "1234.56" 1234.56
    101 p: -              "123456" 1234.56
    102 p: -              "1.234.56" 1.234
    103 p: -              "123456" 1234.56
    104 
    105 loc= "fr"
    106 p: -              "1.234,56" 1234.56
    107 p: -              "1'234,56" 1234.56
    108 p: -              "1 234,56" 1234.56
    109 p: -              "1,234,56" 1.234
    110 p: -              "123456" 1234.56
    111 
    112 loc= "ar-EG"
    113 p: -              "123456" 1234.56
    114 p: -              "123456" 1234.56
    115 p: -              "123456" 1234.56
    116 p: -              "1234,56" 1234.56
    117 p: -              "1234,56" 1234.56
    118 p: -              "1234,56" 1234.56
    119 
    120 strict= true
    121 loc= "en"
    122 p: -              "123456" 1
    123 loc= "fr"
    124 p: -              "123456" 1
    125 loc= "ar"
    126 p: -              "123456" 1234
    127 p: -              "123456" 1234
    128