Fixed decimal point issue in QDecDouble constructor from double.
This commit is contained in:
@@ -28,7 +28,10 @@ QDecDouble& QDecDouble::fromDouble(double d)
|
|||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
_snprintf(str, MaxStrSize, "%.*g", QDecNumDigits, d);
|
_snprintf(str, MaxStrSize, "%.*g", QDecNumDigits, d);
|
||||||
#else
|
#else
|
||||||
|
char *curLoc = setlocale(LC_NUMERIC, NULL);
|
||||||
|
setlocale(LC_NUMERIC, "C");
|
||||||
snprintf(str, MaxStrSize, "%.*g", QDecNumDigits, d);
|
snprintf(str, MaxStrSize, "%.*g", QDecNumDigits, d);
|
||||||
|
setlocale(LC_NUMERIC, curLoc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return fromString(str);
|
return fromString(str);
|
||||||
|
|||||||
Reference in New Issue
Block a user