pub fn tabular_number(value: f64, width: usize, decimals: usize) -> StringExpand description
Format a numeric value with fixed-width padding for vertical alignment. Pads with leading spaces so numbers right-align in columns.
§Arguments
value— The numeric value to formatwidth— Total column width (including decimal point)decimals— Number of decimal places
§Examples
assert_eq!(tabular_number(15.2, 8, 1), " 15.2");
assert_eq!(tabular_number(150.0, 8, 1), " 150.0");