Skip to main content
Version: Next

abs

Returns the absolute value.

abs(x:number) -> number
abs(x:duration) -> duration

Description

This function returns the absolute value for a number or a duration.

x: duration|number

The value to compute absolute value for.

Examples

from {x: -13.3}
x = x.abs()
{x: 13.3}