summaryrefslogtreecommitdiff
path: root/basic/qa/vba_tests/cstr.vb
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2021-09-29 18:19:35 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2021-09-30 09:26:54 +0200
commited166025123a403fbd679377387a45e097f09d6e (patch)
tree5f2c0c52c78d74ef63e9ed0fbe22c5d04daeb027 /basic/qa/vba_tests/cstr.vb
parentf9b6d5c58e1e8e3e2412ff94e30eb4a21b98b099 (diff)
tdf#143575, tdf#143974 - Use rtl::math::doubleToUString to convert numbers to strings
Change-Id: I1427dbd49af680a1bf386410977c9cb2b0a3961e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122831 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'basic/qa/vba_tests/cstr.vb')
-rw-r--r--basic/qa/vba_tests/cstr.vb10
1 files changed, 10 insertions, 0 deletions
diff --git a/basic/qa/vba_tests/cstr.vb b/basic/qa/vba_tests/cstr.vb
index 55e1ab049fab..dfa77b7db1f0 100644
--- a/basic/qa/vba_tests/cstr.vb
+++ b/basic/qa/vba_tests/cstr.vb
@@ -23,6 +23,16 @@ Sub verify_testCStr()
TestUtil.AssertEqual(CStr(n), "437.324", "CStr(n)")
TestUtil.AssertEqual(CStr(500), "500", "CStr(500)")
+ ' tdf#143575 - round string to their nearest double representation
+ ' Without the fix in place, this test would have failed with:
+ ' - Expected: 691.2
+ ' - Actual : 691.2000000000001
+ TestUtil.AssertEqual(CStr(691.2), "691.2", "CStr(691.2)")
+ ' Without the fix in place, this test would have failed with:
+ ' - Expected: 691.2
+ ' - Actual : 691.1999999999999
+ TestUtil.AssertEqual(CStr(123.4 + 567.8), "691.2", "CStr(123.4 + 567.8)")
+
Exit Sub
errorHandler:
TestUtil.ReportErrorHandler("verify_testCStr", Err, Error$, Erl)