MCPcopy Create free account
hub / github.com/codemix/graph / divide

Method divide

packages/graph/src/TemporalTypes.ts:1383–1391  ·  view source on GitHub ↗

* Divide this duration by a scalar.

(scalar: number)

Source from the content-addressed store, hash-verified

1381 * Divide this duration by a scalar.
1382 */
1383 public divide(scalar: number): DurationValue {
1384 if (scalar === 0) return new DurationValue(0, 0, 0, 0);
1385 return new DurationValue(
1386 Math.trunc(this.#months / scalar),
1387 Math.trunc(this.#days / scalar),
1388 Math.trunc(this.#seconds / scalar),
1389 Math.trunc(this.#nanoseconds / scalar),
1390 );
1391 }
1392
1393 /**
1394 * Negate this duration.

Callers 2

resolveConditionValueFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected