Skip to main content
Version: v3

Integer Functions

abs

int.abs(): int

Returns the absolute value of an integer. If the integer is negative, it will return the positive value of it

Input example:

{{ -5.abs() }}

Output:

5

decimal

Read about this function HERE

float

int.float(): float

Converts an integer to a float by adding a decimal part of .0 to the number

Input example:

{{ 5.float() }}

Output:

5.0

The value 0 will be converted to 0.0.

len

int.len(): int

Returns the number of digits in an integer. If the integer is negative, it will return the number of digits excluding the - sign

Input example:

{{ 12345.len() }}

Output:

5

str

int.str(): str

Converts an integer to a string and returns it

Input example:

{{ 5.str() }} and {{ -10.str() }}

Output:

5 and -10