Skip to main content
Version: v2

Integer Functions

abs

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

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

len

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

str(): string

Converts an integer to a string and returns it

Input example

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

Output

5 and -10