summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2010-07-07 17:28:29 +0200
committerNiklas Nebel <nn@openoffice.org>2010-07-07 17:28:29 +0200
commitbcd4bc56c93dd815da6b5d0e22348dabbc75ca9f (patch)
tree6265955c5e936bf3e2bc227da2b9b581d3c6e2f3 /svl
parentbe588658ea127a6a05390435126f1d739a477b58 (diff)
#i112250# #i113022# better handling of automatic decimals for small values or equal cells
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zformat.cxx4
1 files changed, 3 insertions, 1 deletions
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<sal_uInt16>(14)); // limits to 14 decimals