summaryrefslogtreecommitdiffstats
path: root/sal
diff options
context:
space:
mode:
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/strtmpl.hxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sal/rtl/strtmpl.hxx b/sal/rtl/strtmpl.hxx
index 6414115d41..8c63f1081f 100644
--- a/sal/rtl/strtmpl.hxx
+++ b/sal/rtl/strtmpl.hxx
@@ -1527,6 +1527,11 @@ void doubleToString(rtl_tString** pResult, sal_Int32* pResultCapacity, sal_Int32
}
else
{
+ if (nOrigDigits <= nDecPlaces && aParts.exponent >= 0 && fValue < 0x1p53)
+ {
+ // Use integer representation with highest accuracy.
+ nRoundDigits = nOrigDigits; // no rounding
+ }
nDecPlaces = std::max<sal_Int32>(0, nDecPlaces - nExp - 1);
eFormat = rtl_math_StringFormat_F;
}