From bcd4bc56c93dd815da6b5d0e22348dabbc75ca9f Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 7 Jul 2010 17:28:29 +0200 Subject: #i112250# #i113022# better handling of automatic decimals for small values or equal cells --- svl/source/numbers/zformat.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'svl') diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 707b2362f0ed..2d0909c8782b 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2086,7 +2086,9 @@ BOOL SvNumberformat::GetOutputString(double fNumber, if (!nLen) return false; - if (nLen > 11) + // #i112250# With the 10-decimal limit, small numbers are formatted as "0". + // Switch to scientific in that case, too: + if (nLen > 11 || (OutString.EqualsAscii("0") && fNumber != 0.0)) { sal_uInt16 nStandardPrec = rScan.GetStandardPrec(); nStandardPrec = ::std::min(nStandardPrec, static_cast(14)); // limits to 14 decimals -- cgit v1.2.3