diff options
Diffstat (limited to 'sal/rtl/math.cxx')
-rw-r--r-- | sal/rtl/math.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx index 0cd53cd3902a..95dd6ae41bc6 100644 --- a/sal/rtl/math.cxx +++ b/sal/rtl/math.cxx @@ -367,22 +367,22 @@ void doubleToString(typename T::String ** pResult, typename T::Char* pStart = pEnd; // Backward fill. - size_t nGrouping = 0; + sal_Int32 nGrouping = cGroupSeparator && pGroups ? *pGroups : 0; sal_Int32 nGroupDigits = 0; do { typename T::Char nDigit = nInt % 10; nInt /= 10; *--pStart = nDigit + '0'; - if (pGroups && pGroups[nGrouping] == ++nGroupDigits && nInt > 0 && cGroupSeparator) + if (nGrouping && nGrouping == ++nGroupDigits && nInt) { *--pStart = cGroupSeparator; - if (pGroups[nGrouping+1]) - ++nGrouping; + if (*(pGroups + 1)) + nGrouping = *++pGroups; nGroupDigits = 0; } } - while (nInt > 0); + while (nInt); if (bSign) *--pStart = '-'; |