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 0fce086 commit 39f55ceCopy full SHA for 39f55ce
json-to-go.js
@@ -22,7 +22,7 @@ function jsonToGo(json, typename, flatten = true)
22
23
try
24
{
25
- data = JSON.parse(json.replace(/\.0/g, ".1")); // hack that forces floats to stay as floats
+ data = JSON.parse(json.replace(/:(\s*\d*)\.0/g, ":$1.1")); // hack that forces floats to stay as floats
26
scope = data;
27
}
28
catch (e)
0 commit comments