mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00
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:
parent
65d6e5a4f7
commit
6812a7febe
3 changed files with 11 additions and 10 deletions
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue