Docly Developers
Function Updated 30 May 2026

Math.abs(value)

Turns any number into a positive number. If positive no change, if negative the value is multiplied by -1.

Parameters

valuenumberrequired

Value to make positive.

Returns

A positive number

Example

Mixed HTML (or any text file) with inline JavaScript between hash signs.
// expected output: 5
#Math.abs(-5)#

// expected output: 5
#Math.abs(5)#

// expected output: 3.14
#Math.abs(-3.14)#