Skip to main content

as_hours

Macro as_hours 

Source
macro_rules! as_hours {
    ($x:expr) => { ... };
}
Expand description

Converts total attoseconds (i128) → whole hours (i128).

Equivalent to Dt::attos_to_hours.

Truncates toward zero.

§Examples

Example shows attos inputs being built with macros rather than counting attosecond zeros by hand.

use deep_time::macros::{as_hours, hours, mins};

// an amount of attoseconds that is equal to
// −1.5 h becomes −1 hours
assert_eq!(as_hours!(-hours!(1) - mins!(30)), -1);