Float Functions
abs
float.abs(): floatReturns the absolute value of a float. If the float is negative, it will return its positive value.
Input Example:
{{ (-5.125).abs() }}Output:
5.125ceil
float.ceil(): integerReturns the rounded up value of a float to the nearest integer. Causes render error if the result doesn't fit in a 64-bit integer.
Input Example:
{{ 5.125.ceil() }}Output:
6floor
float.floor(): integerReturns the rounded down value of a float to the nearest integer. Causes render error if the result doesn't fit in a 64-bit integer.
Input Example:
{{ 5.125.floor() }}Output:
5int
float.int(): integerConverts a float to an integer by removing the decimal part of the number. It doesn't round the number, it just removes the decimal part. Causes render error if the result doesn't fit in a 64-bit integer.
Input Example:
{{ 5.5.int() }}Output:
5str
float.str(): stringConverts a float to a string. It's useful when you want to manipulate the float as a string. For displaying the float, you don't need to use this function, as Textwire automatically converts the float to a string when displaying it.
Input Example:
{{ 5.125.str() }}Output
5.125