Skip to main content

Number Transforms

Number transforms operate on numeric values using the pipe syntax.

abs

Returns the absolute value of a number.

-5 | abs // 5

ceil

Rounds a number up to the nearest integer.

3.14 | ceil // 4

floor

Rounds a number down to the nearest integer.

3.14 | floor // 3

round

Rounds a number to the nearest integer.

3.5 | round // 4
3.4 | round // 3

random

Generates a random floating-point number between 0 and 1.

null | random // 0.723456789 (random)