Skip to main content

json_float

Function json_float 

Source
pub(crate) fn json_float(
    v: f64,
    short: usize,
    long: usize,
    round_trips: impl Fn(&str) -> bool,
) -> String
Expand description

A float as proto3 JSON written by the C++ library: SimpleFtoa / SimpleDtoa digits (short, else long significant digits when that does not round-trip), non-finite values as the strings proto3 requires.