Use number filters to convert, manipulate, and display numbers.
Returns the absolute value of a number.
Limits a number to a minimum value
Limits a number to a maximum value
Returns the next integer value greater than or equal to the current value.
Divide the current value by operand.
divided_by: object operand
Returns the next integer value less than or equal to the current value.
Returns the object formatted as a string using the provided format string. For numbers, the behavior is the same as the format_number filter below. The format filter may also be used with dates and time_diffs but they require different format strings.
Returns the number formatted as a string using the provided standard or custom format string.
Subtracts the operand from the current value.
minus: object operand
Return the remainder of the current value when divided by the operand.
modulo: object operand
Adds the operand to the current value. Note that this filter behaves differently if the current value is a string.
plus: object operand
Returns a random integer between 0 and the current integer.
Rounds a decimal value to the specified number of places.
round: integer places = 0
Multiply the current value by the operand. Note that this filter behaves differently if the current value is a string and the operand is an integer.
times: object operand
Converts the input into an integer. Useful when grabbing query parameters or other string inputs.
Converts the input into a number, which could be an integer or a fractional number.