Trait FormatFloatValue

Source
pub trait FormatFloatValue {
    // Required method
    fn format_unit(
        &self,
        decimal: usize,
        singular: &str,
        plural: &str,
    ) -> String;
}
Expand description

Trait for formatting floating-point values with their units.

Required Methods§

Source

fn format_unit(&self, decimal: usize, singular: &str, plural: &str) -> String

Formats a value with its unit (singular or plural).

§Arguments
  • decimal - The number of decimal places to display.
  • singular - The singular form of the unit.
  • plural - The plural form of the unit.
§Returns

A formatted string.

Implementations on Foreign Types§

Source§

impl FormatFloatValue for f64

Source§

fn format_unit(&self, decimal: usize, singular: &str, plural: &str) -> String

Implementors§