Skip to main content

ToHoursDecimal

Trait ToHoursDecimal 

Source
pub trait ToHoursDecimal {
    // Required method
    fn to_hours_dec(&self) -> Decimal;

    // Provided method
    fn to_hours_dec_in_ocpi_precision(&self) -> Decimal { ... }
}
Expand description

Convert a TimeDelta into a Decimal based amount of hours.

Required Methods§

Source

fn to_hours_dec(&self) -> Decimal

Return a Decimal based amount of hours.

Provided Methods§

Source

fn to_hours_dec_in_ocpi_precision(&self) -> Decimal

Return a Decimal based amount of hours, in the precision specified by OCPI.

Note this should only be used for output, for intermediate results use to_hours_dec, to avoid rounding.

Implementations on Foreign Types§

Source§

impl ToHoursDecimal for TimeDelta

Implementors§