Liquid filters
Filters change the output of a Liquid object. They are used within an object and are separated by a pipe character.
Filters let you change the way that a Liquid object is displayed. In Current, you'll find the currency
, number
, and localedate
filters used a lot in our document layouts.
Filters are placed within an object after a pipe character( |
), with optional data supplied after a colon.
Common filters
localedate
localedate
Formats a date as per the logged in user’s language settings.
Input
Output
In “English (United States),” this might output 1/12/2021
(M/D/YYY) but in other languages this might output 12/01/2021
(DD/MM/YYYY).
localedatetime
localedatetime
Formats the date and time as per the logged in user’s language settings.
Input
Output
In “English (United States),” this might output 1/12/2021 5:30PM
(M/D/YYY 12hr clock) but in other languages this might output 12/01/2021 17:30
(DD/MM/YYYY 24hr clock).
timezone
timezone
When using 'now'
to return the date and time now, Current RMS returns the UTC time. Use timezone
to change the date and time to a particular region.
For a list of timezones, edit your user profile and check the “Timezone” drop-down.
Date filter referencenumber
number
A decimal precision formatter. You can specify how many decimal places you’d like to add.
Input
Output
currency
currency
Formats a number using the currency symbol set in System Preferences and the user’s language settings.
Input
Output
newline_to_br
newline_to_br
Where you’ve inserted a new line into a text field (\n
), this filter inserts an HTML break (<br>
).
Input
Output
markdown
markdown
Tells Current to format text as Markdown.
Input
Where the external description is...
Output
Thank you for your interest! Contact us if we can do anything.
bool_to_word
bool_to_word
Converts true or false into “Yes” and “No” in your local language.
Input
Output
to_words
to_words
Outputs numbers to words, useful for regions where invoices must show the amount due in words.
Input
Output
String filters
append
append
Add information to the end of a string:
Input
Output
capitalize
capitalize
Makes the first letter of a string capitalized.
Input
Output
downcase
downcase
Change the output to lowercase.
Input
Output
prepend
prepend
Add information to the start of a string:
Input
Output
remove
remove
Removes every occurrence of a particular substring from a string.
Input
Output
remove_first
remove_first
Removes the first occurrence of a particular substring from a string.
Input
Output
truncate
truncate
Truncate a string to a particular number of characters.
Input
Output
upcase
upcase
Change the output to uppercase.
Input
Output
Maths filters
ceil
ceil
Rounds up to the nearest integer.
Input
Output
If the item price is 1.60, this will be 2.
If the item price is 1.30, this will still be 2.
divided_by
divided_by
Divides an output by a number.
Input
floor
floor
Rounds down to the nearest integer.
Input
Output
If the item price is 1.60, this will be 1.
If the item price is 1.30, this will also be 1.
minus
minus
Subtracts a number from an output.
Input
modulo
modulo
Divides an output by a number and returns the remainder.
plus
plus
Adds a number to an output.
Input
round
round
Rounds the output to the nearest integer or specified number of decimals.
Input
Output
If the item price is 1.60, this will be 2.
If the item price is 1.30, this will be 1.
times
times
Multiplies an output by a number.
Input
Array filters
first
first
Returns the first item in an array.
Input
last
last
Returns the last item in an array.
Input
sort
sort
Sorts an array by a given attribute.
Input
Last updated