Skip to main content

round_sig3

Function round_sig3 

Source
pub fn round_sig3(x: f64) -> f64
Expand description

Truncate to 3 significant digits (matching the historical sig3 serializer): values ≥ 1 are truncated to 3 decimals, values < 1 to 3 significant figures. Non-finite values collapse to 0 (JSON has no NaN/Inf).