]> granicus.if.org Git - icu/commitdiff
ICU-11511 Adding tests for CLDR-10103 scientific notation spec changes.
authorShane Carr <shane@unicode.org>
Fri, 5 Oct 2018 01:59:21 +0000 (18:59 -0700)
committerShane F. Carr <shane@unicode.org>
Wed, 24 Oct 2018 00:46:33 +0000 (17:46 -0700)
icu4c/source/test/testdata/numberformattestspecification.txt
icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberformattestspecification.txt

index 6ff99a8f2018644d876bf4d68da1b41685be9b3d..b48cc6c3eee08e8d24e7ca5415d0c73494c28a66 100644 (file)
@@ -204,6 +204,29 @@ pattern    format  output  breaks
 #E0    52413   5,2413E4        K
 0E0    52413   5E4
 
+test scientific infinite precision
+// ICU-11511, ICU-7460, CLDR-10103
+set locale en
+begin
+pattern        format  output  breaks
+// From the spec:
+// "0.##E0 means a max of 3 significant digits."
+0.##E0 98760   9.88E4
+// "#.##E0 also means a max of 3 significant digits."
+#.##E0 98760   9.88E4
+// "#.0#E0 means a max of 2 significant digits."
+#.0#E0 98760   9.9E4   K
+// "0E0 means a max of 1 significant digit."
+0E0    98760   1E5
+// "#E0 means infinite precision."
+#E0    98760   9.876E4 K
+// "###E0 means engineering notation with infinite precision."
+###E0  98760   98.76E3 K
+// Additional tests:
+##0.#E0        98760   99E3    K
+###.#E0        98760   99E3    K
+##0E0  98760   100E3   K
+
 test percents
 set locale fr
 begin
index 6ff99a8f2018644d876bf4d68da1b41685be9b3d..b48cc6c3eee08e8d24e7ca5415d0c73494c28a66 100644 (file)
@@ -204,6 +204,29 @@ pattern    format  output  breaks
 #E0    52413   5,2413E4        K
 0E0    52413   5E4
 
+test scientific infinite precision
+// ICU-11511, ICU-7460, CLDR-10103
+set locale en
+begin
+pattern        format  output  breaks
+// From the spec:
+// "0.##E0 means a max of 3 significant digits."
+0.##E0 98760   9.88E4
+// "#.##E0 also means a max of 3 significant digits."
+#.##E0 98760   9.88E4
+// "#.0#E0 means a max of 2 significant digits."
+#.0#E0 98760   9.9E4   K
+// "0E0 means a max of 1 significant digit."
+0E0    98760   1E5
+// "#E0 means infinite precision."
+#E0    98760   9.876E4 K
+// "###E0 means engineering notation with infinite precision."
+###E0  98760   98.76E3 K
+// Additional tests:
+##0.#E0        98760   99E3    K
+###.#E0        98760   99E3    K
+##0E0  98760   100E3   K
+
 test percents
 set locale fr
 begin