diff options
Diffstat (limited to 'svl/source/numbers/zformat.cxx')
-rw-r--r-- | svl/source/numbers/zformat.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 707b2362f0ed..3d943fef230c 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -47,13 +47,13 @@ #define _ZFORMAT_CXX #include <svl/zformat.hxx> -#include "zforscan.hxx" +#include <zforscan.hxx> #include "zforfind.hxx" #include <svl/zforlist.hxx> #include "numhead.hxx" #include <unotools/digitgroupingiterator.hxx> -#include "nfsymbol.hxx" +#include <svl/nfsymbol.hxx> #include <cmath> @@ -2057,7 +2057,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber, OutString = rScan.GetFalseString(); return FALSE; } - if (eType & NUMBERFORMAT_TEXT && bStandard) + if (eType & NUMBERFORMAT_TEXT) { ImpGetOutputStandard(fNumber, OutString); return FALSE; @@ -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 |