summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-03-23 09:22:54 +0000
committerEike Rathke <erack@redhat.com>2015-03-23 09:26:35 +0000
commite19a11c788d9772c0a27d079819033b7b3e8937b (patch)
treeefd4897d723a38ff0a18f317c82ff5bf809e1a3c
parent86a318ce629fbddb442f8f8ca762eeb3a51c9c6e (diff)
more engineering notation format tests, tdf#30716
Change-Id: Iefb035af9258c21e4fcc7f9b997f40ec318ed1ff
-rw-r--r--basic/qa/vba_tests/format.vb44
1 files changed, 42 insertions, 2 deletions
diff --git a/basic/qa/vba_tests/format.vb b/basic/qa/vba_tests/format.vb
index 54b5610851aa..c40900567f54 100644
--- a/basic/qa/vba_tests/format.vb
+++ b/basic/qa/vba_tests/format.vb
@@ -296,8 +296,48 @@ Sub Custom_Number_Format_Sample()
TestLog_ASSERT TestStr = "1,000,000", "#,###: " & TestStr
'MsgBox TestStr
- TestStr = Format(1.09837555, "######E-###") '109838E-5 => 1E0 with engineering notation
- TestLog_ASSERT TestStr = "1E0", "######E-###: " & TestStr
+ TestStr = Format(1.09837555, "#.#####E+###") '1.09838E+000
+ TestLog_ASSERT TestStr = "1.09838E+000", "#.#####E+###: " & TestStr
+ 'MsgBox TestStr
+
+ TestStr = Format(1.09837555, "###.####E#") '1.0984E0 with engineering notation
+ TestLog_ASSERT TestStr = "1.0984E0", "###.####E#: " & TestStr
+ 'MsgBox TestStr
+
+ TestStr = Format(1098.37555, "###.####E#") '1.0984E3 with engineering notation
+ TestLog_ASSERT TestStr = "1.0984E3", "###.####E#: " & TestStr
+ 'MsgBox TestStr
+
+ TestStr = Format(1098375.55, "###.####E#") '1.0984E6 with engineering notation
+ TestLog_ASSERT TestStr = "1.0984E6", "###.####E#: " & TestStr
+ 'MsgBox TestStr
+
+ TestStr = Format(1.09837555, "######E#") '1E0 with engineering notation
+ TestLog_ASSERT TestStr = "1E0", "######E#: " & TestStr
+ 'MsgBox TestStr
+
+ TestStr = Format(123456.789, "###E0") '123E3 with engineering notation
+ TestLog_ASSERT TestStr = "123E3", "###E0: " & TestStr
+ 'MsgBox TestStr
+
+ TestStr = Format(123567.89, "###E0") '124E3 with engineering notation
+ TestLog_ASSERT TestStr = "124E3", "###E0: " & TestStr
+ 'MsgBox TestStr
+
+ TestStr = Format(12, "###E0") '12E0 with engineering notation
+ TestLog_ASSERT TestStr = "12E0", "###E0: " & TestStr
+ 'MsgBox TestStr
+
+ TestStr = Format(12, "000E0") '012E0 with engineering notation
+ TestLog_ASSERT TestStr = "012E0", "000E0: " & TestStr
+ 'MsgBox TestStr
+
+ TestStr = Format(0.12345, "###E0") '123E-3 with engineering notation
+ TestLog_ASSERT TestStr = "123E-3", "###E0: " & TestStr
+ 'MsgBox TestStr
+
+ TestStr = Format(123456, "####E0") '12E4 with interval-4 notation
+ TestLog_ASSERT TestStr = "12E4", "####E0: " & TestStr
'MsgBox TestStr
TestStr = Format(2345.25, "$#,###.##") '$2.345.25