From e89b22dab8ee99c494150d5ccd1f78ba0c8fe502 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Thu, 11 Nov 2010 13:13:58 +0100 Subject: calc63: #i115512# RoundValueAsShown: don't round to -1 digits for unlimited precision --- sc/source/core/data/documen4.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(SvNumberFormatter::UNLIMITED_PRECISION)) + return fVal; + } double fRound = ::rtl::math::round( fVal, nPrecision ); if ( ::rtl::math::approxEqual( fVal, fRound ) ) return fVal; // durch Rundung hoechstens Fehler -- cgit v1.2.3