diff --git a/qdecimal/src/QDecDouble.cc b/qdecimal/src/QDecDouble.cc index 793d576..7685c88 100644 --- a/qdecimal/src/QDecDouble.cc +++ b/qdecimal/src/QDecDouble.cc @@ -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);