Function finite_or_none
pub fn finite_or_none(v: f64) -> Option<f64>Expand description
Convert NaN / Infinity to None; finite values to Some(v).
serde_json does not support NaN by default, so any metric that can
produce NaN or Infinity (e.g. profit_factor when there are zero
losing trades) must go through this before being stored in an
Option<f64> report field.