MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / to_duration

Function to_duration

cel/src/duration.rs:89–91  ·  view source on GitHub ↗
(num: f64, unit: Unit)

Source from the content-addressed store, hash-verified

87}
88
89fn to_duration(num: f64, unit: Unit) -> Duration {
90 Duration::nanoseconds((num * unit.nanos() as f64).trunc() as i64)
91}
92
93/// Formats a [`Duration`] into a string. String returns a string representing the
94/// duration in the form "72h3m0.5s". Leading zero units are omitted. As a special

Callers 1

parse_number_unitFunction · 0.85

Calls 1

nanosMethod · 0.80

Tested by

no test coverage detected