Ubuntu Pastebin

Paste from nIRV_ at Mon, 5 Sep 2016 07:33:15 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
--- src/corelib/tools/qlocale.cpp
+++ src/corelib/tools/qlocale.cpp
@@ -2753,7 +2753,9 @@ QString QLocaleData::doubleToString(const QChar _zero, const QChar plus, const Q
 
     int decpt;
     int bufSize = 1;
-    if (form == DFDecimal) // optimize for numbers smaller than 512k
+    if (precision == QLocale::FloatingPointShortest)
+        bufSize += DoubleMaxSignificant;
+    else if (form == DFDecimal) // optimize for numbers between -512k and 512k
         bufSize += ((d > (1 << 19) || d < -(1 << 19)) ? DoubleMaxDigitsBeforeDecimal : 6) +
                 precision;
     else // Add extra digit due to different interpretations of precision. Also, "nan" has to fit.
Download as text