Fix to_json() to not lose precision for values of type double

Also changed a few values in the tests for better numerical diversity.
This commit is contained in:
Daniel Thayer 2017-02-02 13:03:05 -06:00
parent 65d6e5a4f7
commit 6812a7febe
3 changed files with 11 additions and 10 deletions

View file

@ -39,10 +39,11 @@ function to_json(v: any, only_loggable: bool &default=F, field_escape_pattern: p
case "count":
fallthrough;
case "time":
fallthrough;
case "double":
return cat(v);
case "double":
return fmt("%.16g", v);
case "bool":
local bval: bool = v;
return bval ? "true" : "false";