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
localedateFormats a date as per the logged in user’s language settings.
Input
{{ invoice.invoiced_at | localedate }}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
localedatetimeFormats the date and time as per the logged in user’s language settings.
Input
{{ order.deliver_starts_at | localedatetime }}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
timezoneWhen 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
numberA decimal precision formatter. You can specify how many decimal places you’d like to add.
Input
Output
currency
currencyFormats a number using the currency symbol set in System Preferences and the user’s language settings.
Input
Output
newline_to_br
newline_to_brWhere you’ve inserted a new line into a text field (\n ), this filter inserts an HTML break (<br> ).
Input
Output
markdown
markdownTells 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_wordConverts true or false into “Yes” and “No” in your local language.
Input
Output
to_words
to_wordsOutputs numbers to words, useful for regions where invoices must show the amount due in words.
Input
Output
String filters
append
appendAdd information to the end of a string:
Input
Output
capitalize
capitalizeMakes the first letter of a string capitalized.
Input
Output
downcase
downcaseChange the output to lowercase.
Input
Output
prepend
prependAdd information to the start of a string:
Input
Output
remove
removeRemoves every occurrence of a particular substring from a string.
Input
Output
remove_first
remove_firstRemoves the first occurrence of a particular substring from a string.
Input
Output
truncate
truncateTruncate a string to a particular number of characters.
Input
Output
upcase
upcaseChange the output to uppercase.
Input
Output
Maths filters
ceil
ceilRounds 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_byDivides an output by a number.
Input
floor
floorRounds 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
minusSubtracts a number from an output.
Input
modulo
moduloDivides an output by a number and returns the remainder.
plus
plusAdds a number to an output.
Input
round
roundRounds 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
timesMultiplies an output by a number.
Input
Array filters
first
firstReturns the first item in an array.
Input
last
lastReturns the last item in an array.
Input
sort
sortSorts an array by a given attribute.
Input
Last updated
Was this helpful?