Skip to content

Commit

Permalink
CA-404591 - rrd: Do not lose precision when converting floats to stri…
Browse files Browse the repository at this point in the history
…ngs (#6238)

`lastupdate` field in the XML RRD blob file, in particular, was getting
truncated floats representing the number of seconds, which loses A LOT
of precision, meaning RRDs could not be checked to have been produced
with the 5-second frequency.
  • Loading branch information
edwintorok authored Jan 17, 2025
2 parents 43d01ca + 731ede7 commit 1e5114c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocaml/libs/xapi-rrd/lib/rrd_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ let array_remove n a =
let f_to_s f =
match classify_float f with
| FP_normal | FP_subnormal ->
Printf.sprintf "%0.5g" f
Printf.sprintf "%0.15g" f
| FP_nan ->
"NaN"
| FP_infinite ->
Expand Down

0 comments on commit 1e5114c

Please sign in to comment.