summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2017-03-12 15:17:30 +0100
committerEike Rathke <erack@redhat.com>2017-03-15 01:20:56 +0000
commit152e9869f8c32fb2c353bfae22db214eba342507 (patch)
treea9c94077d7bae24b4da1c1c0239393528812fa34 /sc/qa/unit/ucalc.cxx
parent60d7644a46970e6eaee882e0c5d65692da206c24 (diff)
tdf#106253 Test Precision as shown for thousand separators
Change-Id: I2e07667884d072a875b7bf5e5c7cf4c3e5d98332 Reviewed-on: https://gerrit.libreoffice.org/35098 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 86aa87798477..13d163e2e0af 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -6780,14 +6780,17 @@ void Test::testPrecisionAsShown()
checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal );
checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal );
}
- { // thousand rounding bogus!!!! tdf#106253
+ { // thousand rounding tdf#106253
aCode = "0,,";
fValue = 4.0e9 / 7.0;
- fExpectedRoundVal = 571e6; // actual is 571428571
- //checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal );
- fValue = -4.0e8 / 7.0;
- fExpectedRoundVal = -57e6; // actual is 57142857
- //checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal );
+ fExpectedRoundVal = 571e6;
+ checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal );
+ checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal );
+ aCode = "\"k\"[$$-409]* #,;[RED]-\"k\"[$$-409]* #,";
+ fValue = 4.0e8 / 7.0;
+ fExpectedRoundVal = 57.143e6;
+ checkPrecisionAsShown( aCode, fValue, fExpectedRoundVal );
+ checkPrecisionAsShown( aCode, -fValue, -fExpectedRoundVal );
}
{ // percent rounding
aCode = "0.00%";