Skip to main content

format_param_value

Function format_param_value 

Source
pub fn format_param_value(info: &ParamInfo, value: f64) -> String
Expand description

Format a plain parameter value as a display string based on the parameter’s unit.

Used by the #[derive(Params)] macro for default format_value implementations on FloatParam and IntParam fields. IntParam is identified by ParamValueKind::Int, set by the derive from the field type - its value is always integer-valued, so the fractional {:.1} / {:.2} formats float-typed params use would render “0.0 st” / “0.00” instead of “0 st” / “0”.