Filters

Filters

A filter after a | turns a value into what the tile shows: {{ cap.measure_power.value | unit: 'W' }} writes 1.82 kW.

Tiledash’s filters

Made for readings: units, temperatures, times.

| round: decimals

A number rounded, to 0 decimals unless given: 21.456 | round: 1 → 21.5.

| decimals: n

A number as text with exactly n decimals (0–3): 21 | decimals: 1 → "21.0"; — when empty.

| percent

A 0–1 value as a percentage: 0.62 | percent → "62 %".

| relative_time

A time as how long ago: cap.onoff.lastUpdated | relative_time → "4 min ago".

| quote

Puts a value into a handler as one quoted text, so it can never add steps.

| duration

Seconds as a duration: 5400 | duration → "1 h 30 min".

Liquid’s filters

The standard ones that read well in a widget.

| strip

Without spaces at its start and end.

| size

How many items a list has, or characters a text.

| last

The last item of a list.

| abs

Without its minus sign.

| ceil

Rounded up to a whole number.

| floor

Rounded down to a whole number.

| escape

HTML characters escaped (output is escaped anyway).