From 78c80199b2884e2911788594ca1485680052a94b Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Sun, 7 May 2017 23:38:46 +0200 Subject: [PATCH] Fixed decimal point issue in QDecDouble constructor from double. --- qdecimal/src/QDecDouble.cc | 3 +++ 1 file changed, 3 insertions(+) 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);