Skip to main content

format_percent

Function format_percent 

Source
pub fn format_percent(value: f64) -> String
Expand description

Format a percentage value (0.0 to 100.0) with 1 decimal place.

ยงExamples

use batuta_common::fmt::format_percent;
assert_eq!(format_percent(45.3), "45.3%");
assert_eq!(format_percent(100.0), "100.0%");