Returns the absolute value of a number.
abs
Will attempt to convert the input to a number before calculating the absolute value, and will return 0 if it is unable to convert the input to a number.
Limits the input to a minimum value.
at_least: Number minimum
Converts both the input and the minimum values to numbers if they are not already numbers. If the input and minimum values cannot both be converted to numbers, return the unaltered input instead.
Use the at_least and at_most filters to limit a number to minimum and maximum values.
Use at_least and at_most to clamp numbers to a range
Copyat_least
at_most
with non-number inputs and parameters
Limits the input to a maximum value.
at_most: Number maximum
Converts both the input and the maximum values to numbers if they are not already numbers. If the input and maximum values cannot both be converted to numbers, return the unaltered input instead.
Use the at_least and at_most filters to limit a number to minimum and maximum values.
Use at_least and at_most to clamp numbers to a range
Copyat_least
at_most
with non-number inputs and parameters
Returns the next integer value greater than or equal to the input.
ceil
Attempts to converts the input to a number if it is not already a number. Returns null if it is unable to convert the input to a number.
Converts the input into a formatted currency as specified by language_tag.
currency: String language_tag
Attempts to convert the input to a number, and if it cannot be converted to a number, the currency filter will return the input as a string instead. If the input is null, returns null. Passing an invalid language_tag results in undefined behavior - likely resulting in a liquid error.
Use the currency filter to format a tag as currency, including the leading or trailing currency identifier.
Format a number as currency
Copyen-US (default)
de
en-GB
es-VE
zh-CN
Divide the input by operand.
divided_by: Number operand
Use the divided_by filter to divide one number by another.
Returns the next integer value less than or equal to the input value.
floor
Attempts to converts the input to a number if it is not already a number. Returns null if it is unable to convert the input to a number.
Returns the input formatted as a string using the provided format string. The format string must be a valid standard or custom .NET numeric format string.
format_number: String format
Returns null if the input cannot be converted to a number.
Use the currency filter to format a tag as currency, including the leading or trailing currency identifier.
Format a number as currency
Copyen-US (default)
de
en-GB
es-VE
zh-CN
number
Subtracts the operand from the input.
minus: Number operand
Use the minus filter to subtract one number from another.
Return the remainder of the input when divided by the operand.
modulo: Number operand
If the input is negative, the result will also be negative. Otherwise the result will be positive.
Use the modulo filter to get the remainder when one number is divided by another.
Using the modulo filter
CopyAdds the operand to the current value. Note that this filter behaves differently if the current value is a string
plus: Number operand
The plus filter may behave differently when used with string input. When used with a string input it may append text to the current value, although that behavior is deprecated and should be replaced by the append filter for optimal forward-compatibility.
Rounds the input to the specified number of decimal places.
round: Integer places
Attempts to converts the input to a number if it is not already a number. Returns null if it is unable to convert the input to a number, or if places is specified but cannot be converted to an integer. If the input is exactly halfway between the smaller and larger number, the round filter will attempt to round toward the nearest even number in the last decimal place (eg: 4.35 rounded to one decimal place would be 4.4)
Use the ceil, floor, and round filters to round numbers up and down.
Using filters to round numbers up and down
Copyceil
floor
round
Non-numeric input
Multiply the input by the operand.
times: Number operand
This filter currently behaves differently if the input is a string and the operand is an integer. In that case the result is a list of strings with input repeated operand times.
You can currently use the times to multiply a string into a list of identical strings, although this behavior is deprecated. If you need this functionality you are advised to find a different way to accomplish it.
Using the times filter with a string
CopyCurrent functionality
Future functionality
Potential Replacement
Alternate Replacement
{{ time }}
Converts the input to an integer.
to_int
If the input is null, returns 0. If the input is non-null and cannot be convert to an integer, returns null.
Converts the input to a number.
to_number
If the input is null, returns 0. If the input is non-null and cannot be convert to an integer, returns null.
Convert a query parameter to a number with a default value.
Convert to number
Copynumber