]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/testdata/numberformattestspecification.txt
ICU-57132.0.1.tar.gz
[apple/icu.git] / icuSources / test / testdata / numberformattestspecification.txt
CommitLineData
2ca993e8
A
1// Copyright (C) 2015-2016, International Business Machines
2// Corporation and others. All Rights Reserved.
3//
4// This file is divided into test suites separated by whitespace. Each test
5// suite starts with the name of the test followed by global field settings
6// for that test suite. After the global settings, comes "begin", the
7// per-test field names, and finally the test specific field values, 1 test
8// per line.
9// For more information on the format of this file, including all the available
10// field names, please see
11// https://docs.google.com/document/d/1T2P0p953_Lh1pRwo-5CuPVrHlIBa_wcXElG-Hhg_WHM/edit?usp=sharing
12
13test plus sign
14set locale ar
15set pattern +0;-#
16begin
17format output breaks
186 \u200F+\u0666 JK
19-6 \u200F-\u0666 JK
20
21test basic patterns
22set locale fr_FR
23set format 1234.567
24begin
25pattern output
26#,##0.## 1\u00a0234,57
270.## 1234,57
280 1235
29#,##0.### 1\u00a0234,567
30###0.###### 1234,567
31###0.0000# 1234,5670
3200000.0000 01234,5670
33#,##0.00 \u00a4 1\u00a0234,57 \u20ac
34'tick''bitten '0.00 tick'bitten 1234,57
35'tick' 'bitten '0.00 tick bitten 1234,57
36
37
38test minimum and maximum fraction digits
39set locale en
40set minIntegerDigits 2
41set maxIntegerDigits 4
42set minFractionDigits 3
43set maxFractionDigits 5
44begin
45format output
466 06.000
476.000005 06.000
486.000006 06.00001
491002003004005 4005.000
50-1002003004005 -4005.000
5112 12.000
5212345 2345.000
5372.1234 72.1234
54
55test int64
56set locale en
57begin
58format output
591002003004005 1002003004005
60-1002003004005 -1002003004005
61
62test rounding
63set locale fr
64begin
65pattern format output breaks
660.5 1.25 1,0 K
670.5 1.75 2,0 K
680.5 -1.25 -1,0 K
6900.5 -1.75 -02,0 K
704 2.0 0 K
714 6.0 8 K
724 10.0 8 K
732.70 99.0 99,90 K
742.73 272.0 273,00 K
75#,#3.70 104.0 1\u00a003,60 K
76
77test significant digits
78set locale en
79set pattern #,#@,@###
80begin
81format output breaks
827 7.0 K
8323 23 K
84100 100 K
851000 1000 K
8610000 1,0000 K
8710001 1,0001 K
8810001.5 1,0002 K
891234567 1,23,4600 K
90-1234567 -1,23,4600 K
913.14159 3.1416 K
92
93test scientific notation
94set locale fr
95begin
96pattern format output breaks
970.00E0 12345 1,23E4
98000.00E0 12300 123,00E2
99000.0#E0 12300 123,0E2
100000.0#E0 12300.1 123,0E2
101000.0#E0 12301.0 123,01E2
102// JDK does not support exponent signs
103000.0#E+00 12301.0 123,01E+02 K
104// JDK gives 12,345E3. JDK seems to include the hashes in significant digits
105##0.00E0 12345 12,3E3 K
106// JDK gives 12,3001E3
107##0.0000E0 12300.1 12,300E3 K
108// JDK gives 12,3001E3
109##0.000#E0 12300.1 12,30E3 K
110##0.000#E0 12301 12,301E3
1110.05E0 12301.2 1,25E4 JK
112##0.000#E0 0.17 170,0E-3
113// JDK doesn't support significant digits in exponents
114@@@E0 6235 6,24E3 K
115@@@#E0 6200 6,20E3 K
116@@@#E0 6201 6,201E3 K
117@@@#E0 6201.7 6,202E3 K
118@@@#E00 6201.7 6,202E03 K
119@@@#E+00 6201.7 6,202E+03 K
120
121test percents
122set locale fr
123begin
124pattern format output breaks
1250.0% 0.573 57,3%
126%0.0 0.573 %57,3
127p%p0.0 0.573 p%p57,3
128p'%'p0.0 0.573 p%p0,6
129%@@@@ 0.0326 %3,260 K
130%#,@@@ 15.43 %1\u00a0540 K
131// JDK does not support rounding increments
132%#,##4.1 16.55 %1\u00a0656,4 K
133// JDK gives %16,255E3
134%##0.00E0 162.55 %16,3E3 K
135
136test permille
137set locale fr
138begin
139pattern format output breaks
1400.0\u2030 0.573 573,0‰
141\u20300.0 0.573 \u2030573,0
142p\u2030p0.0 0.573 p\u2030p573,0
143p'\u2030'p0.0 0.573 p\u2030p0,6
144\u2030@@@@ 0.0326 \u203032,60 K
145\u2030#,@@@ 15.43 \u203015\u00a0400 K
146\u2030#,##4.1 16.55 \u203016\u00a0551,7 K
147// JDK gives \u2030162,55E3
148\u2030##0.00E0 162.55 \u2030163E3 K
149
150test padding
151set locale fr_FR
152begin
153pattern format output breaks
154// JDK does not seem to support padding
155$**####,##0 1234 $***1\u00a0234 K
156*x$####,##0 1234 xxx$1\u00a0234 K
157####,##0*x$ 1234 1\u00a0234xxx$ K
158####,##0$*x 1234 1\u00a0234$xxx K
159// JDK doesn't seem to handle suffixes correctly dropping the 'nx' entirely
160####,##0$*x;ne#n -1234 ne1\u00a0234nx K
161####,##0$*x;n#'*' -1234 n1\u00a0234*xx K
162*y%4.2###### 4.33 yyyy%432,6 K
163// In J ICU adds padding as if 'EUR' is only 2 chars (2 * 0xa4)
164\u00a4\u00a4 **####0.00 433.0 EUR *433,00 JK
165// In J ICU adds padding as if 'EUR' is only 2 chars (2 * 0xa4)
166\u00a4\u00a4 **#######0 433.0 EUR *433,00 JK
167
168test padding and currencies
169begin
170locale currency pattern format output breaks
171// In J, JPY is considered 2 char (2 * 0xa4) even though padding is done
172// after prefix. In C this test works.
173fr JPY \u00a4\u00a4 **#######0 433.22 JPY ****433 JK
174// JDK doesn't correct rounding for currency, shows USD (433
175en USD \u00a4\u00a4 **#######0;\u00a4\u00a4 (#) -433.22 USD (433.22) K
176
177test currencies
178set locale fr
179set format 1234.567
180begin
181pattern currency output breaks
182// JDK gives shows EUR instead of the euro symbol in this case
183#,##0.00 \u00a4 EUR 1\u00a0234,57 \u20ac K
184// JDK gives 1\u00A0234,57. JDK doesn't seem to correct rounding
185// based on currency.
186#,##0.00 \u00a4 JPY 1\u00a0235 JPY K
187
188test prefixes and suffixes
189set locale en
190set pattern 0.00+;(#)
191begin
192format output breaks
1937 7.00+
194// JDK does not support negative suffixes
195-3.5 (3.50) K
196
197test minimum grouping digits
198set locale en
199set pattern #,##0
200set minGroupingDigits 2
201begin
202format output breaks
203// min grouping digits not supported in any existing implementation
204// but could be easily added to the new DecimalFormat C code.
2051000 1000 JK
20610000 10,000
207100000 100,000
2081000000 1,000,000
209
210test min max fraction digits
211set locale en
212set pattern #,##0.###
213set format 1234.567
214begin
215minFractionDigits maxFractionDigits output
2160 0 1,235
2170 2 1,234.57
2184 5 1,234.5670
219
220test min max integer digits
221set locale en
222set pattern #,##0.###
223set format 1234.567
224begin
225minIntegerDigits maxIntegerDigits output
2260 0 .567
2270 3 234.567
2285 5 01,234.567
229
230test min max fraction digits scientific
231set locale en
232set pattern #E0
233set format 299792458.0
234begin
235minIntegerDigits maxIntegerDigits minFractionDigits maxFractionDigits output breaks
236// JDK gives .3E9 instead of unlimited precision.
2370 1 0 0 2.99792458E8 K
2381 1 0 0 3E8
239// JDK gives E0 instead of allowing for unlimited precision
2400 0 0 0 2.99792458E8 K
241// JDK gives .299792E9
2420 1 0 5 2.9979E8 K
243// JDK gives 300E6
2440 3 0 0 299.792458E6 K
245// JDK gives 299.8E6 (maybe maxInt + maxFrac instead of minInt + maxFrac)?
2460 3 0 1 300E6 K
247// JDK gives 299.7925E6
2482 3 0 4 299.792E6 K
249// JDK gives 299.79246E6
2502 3 0 5 299.7925E6 K
2513 3 0 5 299.79246E6
2523 3 0 4 299.7925E6
2532 2 0 3 29.979E7
2544 4 0 0 2998E5
2550 0 1 5 .29979E9
256// JDK gives E0
2570 0 1 0 2.99792458E8 K
258// JDK gives .2998E9
2590 0 0 4 2.998E8 K
260// JDK uses 8 + 6 for significant digits instead of 2 + 6
2612 8 1 6 2.9979246E8 K
262// Treat max int digits > 8 as being the same as min int digits.
263// This behavior is not spelled out in the specification.
264// JDK fails here because it tries to use 9 + 6 = 15 sig digits.
2652 9 1 6 29.979246E7 K
266
267test significant digits scientific
268set locale en
269set pattern #E0
270set format 290000000.0
271begin
272minSigDigits maxSigDigits output breaks
2730 1 3E8 K
2740 2 2.9E8 K
2750 3 2.9E8 K
2761 1 3E8 K
2771 2 2.9E8 K
2781 3 2.9E8 K
2792 2 2.9E8 K
2802 3 2.9E8 K
2813 3 2.90E8 K
2823 4 2.90E8 K
283
284test min max fraction digits scientific 2
285set locale en
286set pattern #E0
287set format 29979245.0
288begin
289minIntegerDigits maxIntegerDigits minFractionDigits maxFractionDigits output breaks
290// JDK gives E0
2910 0 0 0 2.9979245E7 K
292// JDK gives .3E8
2930 1 0 0 2.9979245E7 K
294// JDK gives 2998E4.
2950 4 0 0 2997.9245E4 K
296
297test ticket 11524
298set locale en
299set pattern #,##0.###
300begin
301format maxIntegerDigits output
302123 1 3
303123 -2147483648 0
30412345 1 5
30512345 -2147483648 0
3065.3 1 5.3
3075.3 -2147483648 .3
308
309test patterns with zero
310set locale en
311set format 0
312begin
313pattern output
314#.# 0
315#. 0.
316.# .0
317# 0
31800.000E00 00.000E00
3190.####E0 0E0
320##0.######E000 0E000
321
322test significant digits manually set
323set locale en_US
324set pattern 0.0
325set useSigDigits 1
326set minSigDigits 3
327set maxSigDigits 5
328begin
329format output breaks
3300.0012 0.00120 K
3310.00123 0.00123 K
3320.001234 0.001234 K
3330.0012345 0.0012345 K
3340.00123456 0.0012346 K
335-43 -43.0 K
336-43.7 -43.7 K
337-43.76 -43.76 K
338-43.762 -43.762 K
339-43.7626 -43.763 K
340
341test grouping used setters
342set locale en_US
343set pattern #,##0
344set format 12345
345begin
346output useGrouping
34712,345
34812,345 1
34912345 0
350
351test grouping setters
352set locale en_US
353set pattern 0
354set format 123456789
355set useGrouping 1
356begin
357output grouping breaks grouping2 minGroupingDigits
3581,2345,6789 4
3591,23,45,6789 4 K 2
3601,23,45,6789 4 K 2 2
361123,456789 6 K 6 3
362123456789 6 JK 6 4
363
364test multiplier setters
365set locale en_US
366begin
367format multiplier output breaks
36823 -12 -276
36923 -1 -23
370// ICU4J and JDK throw exception on zero multiplier. ICU4C does not.
37123 0 23 JK
37223 1 23
37323 12 276
374-23 12 -276
375-23 -12 276
376
377test rounding setters
378set locale en_US
379set pattern 0.0#
380set roundingIncrement 0.25
381begin
382format output breaks
383-0.35 -0.25 K
3840.35 0.25 K
3850.39 0.5 K
3860.62 0.5 K
3870.63 0.75 K
388
389test padding setters
390set locale en_US
391set pattern bill0
392set format 1357
393begin
394padCharacter formatWidth output breaks
395* 8 bill1357 K
396* 9 *bill1357 K
397^ 10 ^^bill1357 K
398
399test use scientific setter
400set locale en_US
401set pattern 0.00
402set format 186283
403begin
404output breaks useScientific
405186283.00
4061.86E5 K 1
407186283.00 K 0
408
409test rounding mode setters
410set locale en_US
411set pattern 0.#
412set roundingIncrement 0.5
413begin
414format roundingMode output breaks
4151.24 halfUp 1 K
4161.25 halfUp 1.5 K
4171.25 halfDown 1 K
4181.26 halfDown 1.5 K
4191.25 halfEven 1 K
420-1.01 up -1.5 K
421-1.49 down -1 K
4221.01 up 1.5 K
4231.49 down 1 K
424-1.01 ceiling -1 K
425-1.49 floor -1.5 K
426
427test currency usage setters
428// TODO: Find a country and currency where standard and cash differ
429set locale CH
430set currency CHF
431set pattern \u00a4\u00a4 0
432begin
433format currencyUsage output breaks
4340.37 standard CHF 0.37 K
435// TODO: Get the rounding data into ICU4C and ICU4J
4360.37 cash CHF 0.35 CJK
437
438test exponent parameter setters
439set locale en_US
440set pattern 0.##E0
441set format 299792458
442begin
443decimalSeparatorAlwaysShown exponentSignAlwaysShown minimumExponentDigits output breaks
4440 0 2 3E08 K
4450 1 3 3E+008 K
446// ICU DecimalFormat J does not honor decimalSeparatorAlwaysShown
447// for scientific notation. But JDK DecimalFormat does honor
448// decimalSeparatorAlwaysShown K=JDK; C=ICU4C; J=ICU4J
449// See ticket 11621
4501 0 2 3.E08 JK
4511 1 3 3.E+008 JK
4521 0 1 3.E8 J
4530 0 1 3E8
454
455test exponent decimalSeparatorAlwaysShown default
456set locale en_US
457set pattern 0.##E0
458begin
459format output breaks decimalSeparatorAlwaysShown
460// decimalSeparatorAlwaysShown off by default
461299792458 3E8
462299000000 2.99E8
463299792458 3.E8 J 1
464
465test pad position setters
466set locale en_US
467set pattern **[#####0.##];((#))
468begin
469format padPosition output breaks
47012.34 beforePrefix ****[12.34] K
47112.34 afterPrefix [****12.34] K
47212.34 beforeSuffix [12.34****] K
47312.34 afterSuffix [12.34]**** K
474-12.34 beforePrefix **((12.34)) K
475-12.34 afterPrefix ((**12.34)) K
476-12.34 beforeSuffix ((12.34**)) K
477-12.34 afterSuffix ((12.34))** K
478
479test affix setters
480set locale fr_FR
481set currency EUR
482set pattern 0.00
483begin
484format positivePrefix positiveSuffix negativePrefix negativeSuffix output
48512.34 % %12,34
48612.34 \u00a4\u00a4 12,34\u00a4\u00a4
48712.34 - + 12,34
488-12.34 - + -12,34+
489-12.34 \u00a4 \u00a412,34
49012.34 \u00a4 12,34
491-12.34 % 12,34%
49212.34 % 12,34
493
494test more affix setters
495set locale fr_FR
496set pattern %0.00
497begin
498format positivePrefix negativePrefix output
4990.648 booya cooya booya64,80
500
501test nan and infinity
502set locale en_US
503set pattern [0.00];(#)
504begin
505format output breaks
506Inf [\u221e] K
507-Inf (\u221e) K
508NaN NaN K
509
510test nan and infinity with multiplication
511set locale en
512set multiplier 100
513begin
514format output breaks
515Inf \u221e
516-Inf -\u221e
517NaN NaN K
518
519test nan and infinity with padding
520set locale en_US
521set pattern $$$0.00$
522set formatWidth 7
523begin
524format padPosition output breaks
525Inf beforePrefix $$$\u221e$ K
526Inf afterPrefix $$$ \u221e$ K
527Inf beforeSuffix $$$\u221e $ K
528Inf afterSuffix $$$\u221e$ K
529NaN beforePrefix NaN K
530NaN afterPrefix NaN K
531NaN beforeSuffix NaN K
532NaN afterSuffix NaN K
533
534test apply localized patterns
535begin
536locale localizedPattern format output breaks
537en 0% 0.4376 44%
538// This next test breaks JDK. JDK doesn't multiply by 100.
539fa \u06f0\u066a 0.4376 \u06f4\u06f4\u066a K
540
541test toPattern
542set locale en
543begin
544pattern toPattern breaks
545// JDK doesn't support any patterns with padding or both negative prefix and suffix
546// Breaks ICU4J See ticket 11671
547**0,000 **0,000 JK
548**##0,000 **##0,000 K
549**###0,000 **###0,000 K
550**####0,000 **#,##0,000 K
551###,000. #,000.
5520,000 #0,000
553.00 #.00
554000 #000
555000,000 #,000,000
556pp#,000 pp#,000
55700.## #00.##
558#,#00.025 #,#00.025
559// No secondary grouping in JDK
560#,##,###.02500 #,##,###.02500 K
561pp#,000;(#) pp#,000;(#,000) K
562**####,##,##0.0##;(#) **#,##,##,##0.0##;**(##,##,##0.0##) K
563// No significant digits in JDK
564@@### @@### K
565@,@#,### @,@#,### K
5660.00E0 0.00E0
567@@@##E0 @@@##E0 K
568###0.00#E0 ###0.00#E0
569##00.00#E0 ##00.00#E0
5700.00E+00 0.00E+00 K
571000.00E00 000.00E00
572###0.00#E00 ###0.00#E00
573
574test parse
575set locale en
576set pattern +#,##0.0###;(#)
577begin
578parse output breaks
579+5,347.25 5347.25
580+5,347,.25 5347.25
581+5,347, 5347
582+5347,,, 5347
583+5347,,,d8 5347
584(5,347.25) -5347.25
585// J requires prefix and suffix for lenient parsing, but C doesn't
5865,347.25 5347.25 JK
587(5,347.25 -5347.25 J
588-5,347.25 fail
589+3.52E4 35200
590(34.8E-3) -0.0348
591// JDK stops parsing at the spaces. JDK doesn't see space as a grouping separator
592(34 25E-1) -342.5 K
593(34,,25E-1) -342.5
594// J doesn't allow trailing separators before E but C does
595(34,,25,E-1) -342.5 J
596(34 25 E-1) -342.5 JK
597(34,,25 E-1) -3425 J
598// Spaces are not allowed after exponent symbol
599// C parses up to the E but J bails
600(34 25E -1) -3425 JK
601+3.52EE4 3.52
602+1,234,567.8901 1234567.8901
603+1,23,4567.8901 1234567.8901
604+1,23,4567.89,01 1234567.89
605+1,23,456.78.9 123456.78
606+12.34,56 12.34
607+79,,20,3 79203
608+79 20 3 79203 K
609// Parsing stops at comma as it is different from other separators
610+79 20,3 7920 K
611+79,,20 3 7920
612+ 79 79 K
613+,79,,20,3 79203
614+7920d3 7920
615// Whitespace immediately after prefix doesn't count as digit separator
616// in C but is does in J
617+ ,79,,20,3 79203 JK
618( 19 45) -1945 K
619// C allows trailing separators when there is a prefix and suffix.
620// J allows trailing separators only when there is just a prefix.
621// In this case, J just bails
622( 19 45 ) -1945 JK
623(,,19,45) -1945
624// C parses to the space, but J bails
625(,,19 45) -19 J
626// J bails b/c comma different separator than space. C doesn't treat leading spaces
627// as a separator.
628( 19,45) -1945 JK
629// J bails. Doesn't allow trailing separators when there is prefix and suffix.
630(,,19,45,) -1945 J
631// J bails on next 4 because J doesn't allow letters inside prefix and suffix.
632// C will parse up to the letter.
633(,,19,45,d1) -1945 J
634(,,19,45d1) -1945 J
635( 19 45 d1) -1945 JK
636( 19 45d1) -1945 JK
637// J does allow trailing separator before a decimal point
638(19,45,.25) -1945.25
639// 2nd decimal points are ignored
640+4.12.926 4.12
641
642test parse suffix
643set locale en
644set pattern #,##0.0###+;#-
645begin
646parse output breaks
647// C sees this as -3426, don't understand why
6483426 -3426 JK
6493426+ 3426
650// J bails, but JDK will parse up to the space and get 34.
651// C sees -34
65234 d1+ -34 JK
653// JDK sees this as -1234 for some reason
654// J bails b/c of trailing separators
655// C parses until trailing separators, but sees -1234
6561,234,,,+ -1234 JK
6571,234- -1234
658// J bails because of trailing separators
6591,234,- -1234 J
660// J bails here too
6611234 - -1234 J
662
663
664
665test parse strict
666set locale en
667set pattern +#,##0.0###;(#)
668set lenient 0
669begin
670parse output breaks
671+123d5 123
672+5347.25 5347.25
673// separators in wrong place cause failure, no separators ok.
674+5,347.25 5347.25
675(5347.25) -5347.25
676(5,347.25) -5347.25
677// JDK does allow separators in the wrong place and parses as -5347.25
678(53,47.25) fail K
679// strict requires prefix or suffix
6805,347.25 fail
681+3.52E4 35200
682(34.8E-3) -0.0348
683(3425E-1) -342.5
684// Strict doesn't allow separators in sci notation.
685(3,425) -3425
686// JDK allows separators in sci notation and parses as -342.5
687(3,425E-1) fail K
688// Both prefix and suffix needed for strict.
689// JDK accepts this and parses as -342.5
690(3425E-1 fail K
691+3.52EE4 3.52
692+1,234,567.8901 1234567.8901
693// With strict digit separators don't have to be the right type
694// JDK doesn't acknowledge space as a separator
695+1 234 567.8901 1234567.8901 K
696// In general the grouping separators have to match their expected
697// location exactly. The only exception is when string being parsed
698// have no separators at all.
699+1,234,567.8901 1234567.8901
700// JDK doesn't require separators to be in the right place
701+1,23,4567.8901 fail K
702+1234,567.8901 fail K
703+1,234567.8901 fail K
704+1234567.8901 1234567.8901
705// Comma after decimal means parse to a comma
706+123,456.78,9 123456.78
707// A decimal after a decimal means bail
708// JDK parses as 123456.78
709+123,456.78.9 fail K
710+79 79
711+79 79
712+ 79 fail
713// JDK parses as -1945
714(1,945d1) fail K
715
716test parse integer only
717set locale en
718set pattern 0.00
719set parseIntegerOnly 1
720begin
721parse output breaks
72235 35
723+35 fail
724-35 -35
7252.63 2
726-39.99 -39
727
728test parse no exponent flag
729set pattern 0
730set locale en
731begin
732parseNoExponent parse output breaks
733// JDK doesn't allow lowercase exponent but ICU4J and ICU4C do.
7340 5e2 500 K
7350 5.3E2 530
736// See ticket 11725
7371 5e2 5 J
7381 5.3E2 5.3 JK
739
740test parse currency fail
741set pattern 0
742set locale en
743begin
744parse output outputCurrency breaks
745// See ticket 11735
74653.45 fail USD J
747
748test parse strange prefix
749set locale en
750set positivePrefix dd
751set negativePrefix ddd
752begin
753parse output
754dd4582 4582
755ddd4582 -4582
756
757test parse strange suffix
758set locale en
759set positiveSuffix dd
760set negativePrefix
761set negativeSuffix ddd
762begin
763parse output
7644582dd 4582
7654582ddd -4582
766
767test really strange suffix
768set locale en
769set positiveSuffix 9K
770set negativePrefix
771set negativeSuffix 9N
772begin
773parse output breaks
774// C consumes the '9' as a digit and assumes number is negative
775// J and JDK bail
776// 6549K 654 CJK
777// C consumes the '9' as a digit and assumes number is negative
778// J and JDK bail
779// 6549N -654 CJK
780
781test really strange prefix
782set locale en
783set positivePrefix 82
784set negativePrefix 28
785begin
786parse output
7878245 45
7882845 -45
789
790test select
791set locale sr
792begin
793format pattern plural
794Inf 0 other
795-Inf 0 other
796NaN 0 other
797Inf 0.0 other
798-Inf 0.0 other
799NaN 0.0 other
8001 0 one
8011 0.0 other
8022 0 few
8032 0.0 other
8042 0E0 other
8055.1 0.0 one
8065.09 0.0 one
807
808test parse currency ISO
809set pattern 0.00 \u00a4\u00a4;(#) \u00a4\u00a4
810set locale en_US
811begin
812parse output outputCurrency breaks
813$53.45 53.45 USD
81453.45 USD 53.45 USD
815USD 53.45 53.45 USD J
81653.45USD fail USD
817USD53.45 53.45 USD
818(7.92) USD -7.92 USD
819(7.92) EUR -7.92 EUR
820(7.926) USD -7.926 USD
821(7.926 USD) fail USD
822(USD 7.926) fail USD
823USD (7.926) fail USD
824USD (7.92) fail USD
825(7.92)USD fail USD
826USD(7.92) fail USD
827(8) USD -8 USD
828-8 USD fail USD
82967 USD 67 USD
83053.45$ fail USD
831US Dollars 53.45 53.45 USD J
83253.45 US Dollars 53.45 USD
833US Dollar 53.45 53.45 USD J
83453.45 US Dollar 53.45 USD
835US Dollars53.45 53.45 USD
83653.45US Dollars fail USD
837US Dollar53.45 53.45 USD
838US Dollat53.45 fail USD
83953.45US Dollar fail USD
840US Dollars (53.45) fail USD
841(53.45) US Dollars -53.45 USD
842US Dollar (53.45) fail USD
843(53.45) US Dollar -53.45 USD
844US Dollars(53.45) fail USD
845(53.45)US Dollars fail USD
846US Dollar(53.45) fail USD
847US Dollat(53.45) fail USD
848(53.45)US Dollar fail USD
849
850
851test parse currency ISO negative
852set pattern 0.00 \u00a4\u00a4;-# \u00a4\u00a4
853set locale en_US
854begin
855parse output outputCurrency breaks
856$53.45 53.45 USD
85753.45 USD 53.45 USD
858USD 53.45 53.45 USD J
85953.45USD fail USD
860USD53.45 53.45 USD
861-7.92 USD -7.92 USD
862-7.92 EUR -7.92 EUR
863-7.926 USD -7.926 USD
864USD -7.926 fail USD
865-7.92USD fail USD
866USD-7.92 fail USD
867-8 USD -8 USD
86867 USD 67 USD
86953.45$ fail USD
870US Dollars 53.45 53.45 USD J
87153.45 US Dollars 53.45 USD
872US Dollar 53.45 53.45 USD J
87353.45 US Dollar 53.45 USD
874US Dollars53.45 53.45 USD
87553.45US Dollars fail USD
876US Dollar53.45 53.45 USD
877US Dollat53.45 fail USD
87853.45US Dollar fail USD
879
880
881test parse currency long
882set pattern 0.00 \u00a4\u00a4\u00a4;(#) \u00a4\u00a4\u00a4
883set locale en_US
884begin
885parse output outputCurrency breaks
886$53.45 53.45 USD
88753.45 USD 53.45 USD
888USD 53.45 53.45 USD J
889// See ticket 11735
89053.45USD fail USD J
891USD53.45 53.45 USD
892(7.92) USD -7.92 USD
893(7.926) USD -7.926 USD
894(7.926 USD) fail USD
895(USD 7.926) fail USD
896USD (7.926) fail USD
897USD (7.92) fail USD
898(7.92)USD fail USD
899USD(7.92) fail USD
900(8) USD -8 USD
901// See ticket 11735
902-8 USD fail USD J
90367 USD 67 USD
904// See ticket 11735
90553.45$ fail USD J
906US Dollars 53.45 53.45 USD J
90753.45 US Dollars 53.45 USD
908US Dollar 53.45 53.45 USD J
90953.45 US Dollar 53.45 USD
910US Dollars53.45 53.45 USD
911// See ticket 11735
91253.45US Dollars fail USD J
913US Dollar53.45 53.45 USD
914US Dollat53.45 fail USD
915// See ticket 11735
91653.45US Dollar fail USD J
917
918
919test parse currency short
920set pattern 0.00 \u00a4;(#) \u00a4
921set locale en_US
922begin
923parse output outputCurrency breaks
924$53.45 53.45 USD
92553.45 USD 53.45 USD
926USD 53.45 53.45 USD J
92753.45USD fail USD
928USD53.45 53.45 USD
929(7.92) USD -7.92 USD
930(7.926) USD -7.926 USD
931(7.926 USD) fail USD
932(USD 7.926) fail USD
933USD (7.926) fail USD
934USD (7.92) fail USD
935(7.92)USD fail USD
936USD(7.92) fail USD
937(8) USD -8 USD
938-8 USD fail USD
93967 USD 67 USD
94053.45$ fail USD
941US Dollars 53.45 53.45 USD J
94253.45 US Dollars 53.45 USD
943US Dollar 53.45 53.45 USD J
94453.45 US Dollar 53.45 USD
945US Dollars53.45 53.45 USD
94653.45US Dollars fail USD
947US Dollar53.45 53.45 USD
948US Dollat53.45 fail USD
94953.45US Dollar fail USD
950
951
952test parse currency short prefix
953set pattern \u00a40.00;(\u00a4#)
954set locale en_US
955begin
956parse output outputCurrency breaks
957$53.45 53.45 USD
95853.45 USD fail USD
959USD 53.45 53.45 USD J
96053.45USD fail USD
961USD53.45 53.45 USD
962(7.92) USD fail USD
963(7.926) USD fail USD
964(7.926 USD) fail USD
965(USD 7.926) -7.926 USD J
966USD (7.926) fail USD
967USD (7.92) fail USD
968(7.92)USD fail USD
969USD(7.92) fail USD
970(8) USD fail USD
971-8 USD fail USD
97267 USD fail USD
97353.45$ fail USD
974US Dollars 53.45 53.45 USD J
97553.45 US Dollars 53.45 USD
976US Dollar 53.45 53.45 USD J
97753.45 US Dollar 53.45 USD
978US Dollars53.45 53.45 USD
97953.45US Dollars fail USD
980US Dollar53.45 53.45 USD
98153.45US Dollar fail USD
982
983test format foreign currency
984set locale fa_IR
985begin
986pattern format output breaks
987\u00a4\u00a4\u00a4 0.00;\u00a4\u00a4\u00a4 # 1235 \u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 K
988\u00a4\u00a4 0.00;\u00a4\u00a4 -# 1235 IRR \u06F1\u06F2\u06F3\u06F5 K
989\u00a4 0.00;\u00a4 -# 1235 \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 K
990
991test parse foreign currency symbol
992set pattern \u00a4 0.00;\u00a4 -#
993set locale fa_IR
994begin
995parse output outputCurrency
996\u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
997IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
998\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR
999IRR 1235 1235 IRR
1000\u0631\u06cc\u0627\u0644 1235 1235 IRR
1001\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR
1002
1003test parse foreign currency ISO
1004set pattern \u00a4\u00a4 0.00;\u00a4\u00a4 -#
1005set locale fa_IR
1006begin
1007parse output outputCurrency
1008\u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
1009IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
1010\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR
1011IRR 1235 1235 IRR
1012\u0631\u06cc\u0627\u0644 1235 1235 IRR
1013\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR
1014
1015test parse foreign currency full
1016set pattern \u00a4\u00a4\u00a4 0.00;\u00a4\u00a4\u00a4 -#
1017set locale fa_IR
1018begin
1019parse output outputCurrency
1020\u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR
1021IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR
1022\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR
1023IRR 1235 1235 IRR
1024\u0631\u06cc\u0627\u0644 1235 1235 IRR
1025\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR
1026
1027test parse currency with foreign symbols symbol english
1028set pattern \u00a4 0.00;\u00a4 (#)
1029set locale en_US
1030begin
1031parse output outputCurrency
1032EUR 7.82 7.82 EUR
1033\u20ac 7.82 7.82 EUR
1034Euro 7.82 7.82 EUR
1035Euros 7.82 7.82 EUR
1036
1037test parse currency with foreign symbols ISO english
1038set pattern \u00a4\u00a4 0.00;\u00a4\u00a4 (#)
1039set locale en_US
1040begin
1041parse output outputCurrency
1042EUR 7.82 7.82 EUR
1043\u20ac 7.82 7.82 EUR
1044Euro 7.82 7.82 EUR
1045Euros 7.82 7.82 EUR
1046
1047test parse currency with foreign symbols full english
1048set pattern \u00a4\u00a4\u00a4 0.00;\u00a4\u00a4\u00a4 (#)
1049set locale en_US
1050begin
1051parse output outputCurrency
1052EUR 7.82 7.82 EUR
1053\u20ac 7.82 7.82 EUR
1054Euro 7.82 7.82 EUR
1055Euros 7.82 7.82 EUR
1056
1057test parse currency ISO strict
1058set pattern 0.00 \u00a4\u00a4;(#) \u00a4\u00a4
1059set locale en_US
1060set lenient 0
1061begin
1062parse output outputCurrency breaks
1063$53.45 53.45 USD
106453.45 USD 53.45 USD
1065USD 53.45 fail USD
106653.45USD fail USD
1067USD53.45 53.45 USD
1068(7.92) USD -7.92 USD
1069(7.92) EUR -7.92 EUR
1070(7.926) USD -7.926 USD
1071(7.926 USD) fail USD
1072(USD 7.926) fail USD
1073USD (7.926) fail USD
1074USD (7.92) fail USD
1075(7.92)USD fail USD
1076USD(7.92) fail USD
1077(8) USD -8 USD
1078-8 USD fail USD
107967 USD 67 USD
108053.45$ fail USD
1081US Dollars 53.45 fail USD
108253.45 US Dollars 53.45 USD
1083US Dollar 53.45 fail USD
108453.45 US Dollar 53.45 USD
1085US Dollars53.45 53.45 USD
108653.45US Dollars fail USD
1087US Dollar53.45 53.45 USD
1088US Dollat53.45 fail USD
108953.45US Dollar fail USD
1090US Dollars (53.45) fail USD
1091(53.45) US Dollars -53.45 USD
1092US Dollar (53.45) fail USD
1093(53.45) US Dollar -53.45 USD
1094US Dollars(53.45) fail USD
1095(53.45)US Dollars fail USD
1096US Dollar(53.45) fail USD
1097US Dollat(53.45) fail USD
1098(53.45)US Dollar fail USD
1099
1100test ticket 10436
1101set locale en
1102set roundingMode ceiling
1103set minFractionDigits 0
1104set maxFractionDigits 0
1105begin
1106format output breaks
1107-0.99 -0 JK
1108