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§
Sourcefn to_hours_dec(&self) -> Decimal
fn to_hours_dec(&self) -> Decimal
Return a Decimal based amount of hours.
Provided Methods§
Sourcefn to_hours_dec_in_ocpi_precision(&self) -> Decimal
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.