This commit is contained in:
Stefano Fiorentino 2016-02-12 12:09:18 +01:00
parent 341e9c272f
commit ee2ef58555

View File

@ -143,7 +143,7 @@ std::string valueToString(double value, bool useSpecialFloats, unsigned int prec
unsigned int length = (value==0.0)?(unsigned int)1:(unsigned int)(std::floor(std::log10(std::abs(value)))+1);
if (length<1) length=1;
if (lenght>precision-1) length = precision-1;
if (length>precision-1) length = precision-1;
char formatString[6];
sprintf(formatString, "%%.%dg", precision-length);