Skip to main content

Module units

Module units 

Source
Expand description

Unit-conversion constants shared workspace-wide.

Every crate that mixes seconds/milliseconds or dollars/micro-dollars must use these names rather than open-coding the conversion factors — a misplaced 1_000 vs 1_000_000 was a real class of bug in earlier rounds of this review.

Constants§

MS_PER_DAY
Milliseconds per day.
MS_PER_HOUR
Milliseconds per hour.
MS_PER_SEC
Milliseconds per second.
SECS_PER_DAY
Seconds per day.
USD_MICROS_PER_DOLLAR
USD micro-units per dollar. All internal cost bookkeeping stays in micro-USD (u64) to keep every arithmetic step in exact integers; only wire-facing serialization converts to floating point.