Format seconds (signed) as an ISO 8601 duration string suitable for
IfcDuration. Prefers the coarsest integer unit that divides cleanly to
avoid noisy "PT432000S" style output for round values like "P5D". Negative
input emits the ISO 8601-2 signed form ("-P2D") — see the module doc
comment for why.
Non-finite input (NaN, ±Infinity) returns undefined rather than
PT0S: a zero lag is a legitimate value, so returning it for broken
input would fabricate a real-looking answer from a malformed one (e.g. an
unparsable MSPDI LinkLag propagating as NaN through Math.round in
build.ts). undefined here means "emit no IFCLAGTIME", matching how an
unrepresentable lag is already handled by the caller.
Format seconds (signed) as an ISO 8601 duration string suitable for
IfcDuration. Prefers the coarsest integer unit that divides cleanly to avoid noisy "PT432000S" style output for round values like "P5D". Negative input emits the ISO 8601-2 signed form ("-P2D") — see the module doc comment for why.Non-finite input (
NaN,±Infinity) returnsundefinedrather thanPT0S: a zero lag is a legitimate value, so returning it for broken input would fabricate a real-looking answer from a malformed one (e.g. an unparsable MSPDILinkLagpropagating asNaNthroughMath.roundinbuild.ts).undefinedhere means "emit no IFCLAGTIME", matching how an unrepresentable lag is already handled by the caller.