Fixed decimal point issue in QDecDouble constructor from double.

master
Josef Rokos 8 years ago
parent 50ecd60c9a
commit 78c80199b2

@ -28,7 +28,10 @@ QDecDouble& QDecDouble::fromDouble(double d)
#if defined(_MSC_VER)
_snprintf(str, MaxStrSize, "%.*g", QDecNumDigits, d);
#else
char *curLoc = setlocale(LC_NUMERIC, NULL);
setlocale(LC_NUMERIC, "C");
snprintf(str, MaxStrSize, "%.*g", QDecNumDigits, d);
setlocale(LC_NUMERIC, curLoc);
#endif
return fromString(str);

Loading…
Cancel
Save