diff --git a/core/parser.cpp b/core/parser.cpp index 41e28ecaf..2b6b9edf4 100644 --- a/core/parser.cpp +++ b/core/parser.cpp @@ -23,6 +23,7 @@ limitations under the License. #include #include #include +#include #include #include "ast.h" @@ -34,6 +35,9 @@ limitations under the License. std::string jsonnet_unparse_number(double v) { std::stringstream ss; + // Make sure we output the same thing, even if the user + // of the library changed the global locale + ss.imbue(std::locale::classic()); if (v == floor(v)) { ss << std::fixed << std::setprecision(0) << v; } else {