We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c53f3c commit dee145aCopy full SHA for dee145a
core/parser.cpp
@@ -23,6 +23,7 @@ limitations under the License.
23
#include <memory>
24
#include <set>
25
#include <sstream>
26
+#include <locale>
27
#include <string>
28
29
#include "ast.h"
@@ -36,6 +37,9 @@ namespace jsonnet::internal {
36
37
std::string jsonnet_unparse_number(double v)
38
{
39
std::stringstream ss;
40
+ // Make sure we output the same thing, even if the user
41
+ // of the library changed the global locale
42
+ ss.imbue(std::locale::classic());
43
if (v == floor(v)) {
44
ss << std::fixed << std::setprecision(0) << v;
45
} else {
0 commit comments