round
Returns a new Duration rounded to the given smallest/largest unit and/or balanced.
Parameters
- self:Duration
- Duration
- options:RoundingOptions
- RoundingOptions
Source
Implementation
pub fn round(self: Duration, options: RoundingOptions) !Duration {
const rel = if (options.relative_to) |r| abi.to.durRelativeTo(r) else abi.c.RelativeTo{ .date = null, .zoned = null };
return wrapDuration(abi.c.temporal_rs_Duration_round(self._inner, abi.to.durRoundingOpts(options), rel));
}