summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2010-11-11 13:13:58 +0100
committerNiklas Nebel <nn@openoffice.org>2010-11-11 13:13:58 +0100
commite89b22dab8ee99c494150d5ccd1f78ba0c8fe502 (patch)
treecdc784ff0b9af9ff268668e9e90dad18ed2d2b9b
parent2d9884e79d5885ee708e29dbd21b13ad0c3e6631 (diff)
calc63: #i115512# RoundValueAsShown: don't round to -1 digits for unlimited precision
-rw-r--r--sc/source/core/data/documen4.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index cbd55fd5f..d2cbca2c4 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -505,7 +505,7 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat )
&& nType != NUMBERFORMAT_TIME && nType != NUMBERFORMAT_DATETIME )
{
short nPrecision;
- if ( nFormat )
+ if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0)
{
nPrecision = (short)GetFormatTable()->GetFormatPrecision( nFormat );
switch ( nType )
@@ -524,7 +524,12 @@ double ScDocument::RoundValueAsShown( double fVal, ULONG nFormat )
}
}
else
+ {
nPrecision = (short)GetDocOptions().GetStdPrecision();
+ // #i115512# no rounding for automatic decimals
+ if (nPrecision == static_cast<short>(SvNumberFormatter::UNLIMITED_PRECISION))
+ return fVal;
+ }
double fRound = ::rtl::math::round( fVal, nPrecision );
if ( ::rtl::math::approxEqual( fVal, fRound ) )
return fVal; // durch Rundung hoechstens Fehler