t in whole seconds. The second result is false when the value does not fit an s64. Truncates toward zero, or rounds
to nearest with DO_ROUNDING.
to_seconds :: (
t: Apollo_Time,
$DO_ROUNDING := false
) -> (result: s64, success: bool)
Parameters
- t: Apollo_Time
- $DO_ROUNDING := false
Returns
- result: s64
- success: bool
seconds, ok := to_seconds(milliseconds_to_apollo(2500));
assert(ok && seconds == 2);
rounded, ok2 := to_seconds(milliseconds_to_apollo(2500), true);
assert(ok2 && rounded == 3);