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

Formats 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

Formats 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

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 reference

number

A decimal precision formatter. You can specify how many decimal places you’d like to add.

Input

Output

currency

Formats a number using the currency symbol set in System Preferences and the user’s language settings.

Input

Output

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

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

Converts true or false into “Yes” and “No” in your local language.

Input

Output

to_words

Outputs numbers to words, useful for regions where invoices must show the amount due in words.

Input

Output

String filters

append

Add information to the end of a string:

Input

Output

capitalize

Makes the first letter of a string capitalized.

Input

Output

downcase

Change the output to lowercase.

Input

Output

prepend

Add information to the start of a string:

Input

Output

remove

Removes every occurrence of a particular substring from a string.

Input

Output

remove_first

Removes the first occurrence of a particular substring from a string.

Input

Output

truncate

Truncate a string to a particular number of characters.

Input

Output

upcase

Change the output to uppercase.

Input

Output

Maths filters

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

Divides an output by a number.

Input

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

Subtracts a number from an output.

Input

modulo

Divides an output by a number and returns the remainder.

plus

Adds a number to an output.

Input

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

Multiplies an output by a number.

Input

Array filters

first

Returns the first item in an array.

Input

last

Returns the last item in an array.

Input

sort

Sorts an array by a given attribute.

Input

Last updated

Was this helpful?