Skip to main content

FormatFloatValue

Trait FormatFloatValue 

Source
pub trait FormatFloatValue {
    // Required method
    fn format_float_unit(&self, decimal: usize, unit: Unit) -> String;
}
Expand description

Trait for formatting floating-point values with their units

Required Methods§

Source

fn format_float_unit(&self, decimal: usize, unit: Unit) -> String

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

§Arguments
  • decimal - The number of decimal places to display.
  • unit - Unit types with their singular/plural pairs.
§Returns

A formatted string.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FormatFloatValue for f64

Source§

fn format_float_unit(&self, decimal: usize, unit: Unit) -> String

Implementors§