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

<b>{{ -5.abs() }}</b>

Output

<b>5</b>

float

float(): float

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

Input example

<b>{{ 5.float() }}</b>

Output

<b>5.0</b>

str

str(): string

Converts an integer to a string and returns it

Input example

<b>{{ 5.str() }} and {{ -10.str() }}</b>

Output

<b>5 and -10</b>