| round: decimals
A number rounded, to 0 decimals unless given: 21.456 | round: 1 → 21.5.
The Liquid filters a widget template can use: Tiledash’s own for readings, and Liquid’s standard ones.
| round: decimalsA number rounded, to 0 decimals unless given: 21.456 | round: 1 → 21.5.
| decimals: nA number as text with exactly n decimals (0–3), with the region's decimal mark: 21 | decimals: 1 → "21.0" ("21,0" in the Netherlands); — when empty.
| percentA 0–1 value as a percentage, written the region's way: 0.62 | percent → "62%" ("62 %" in Germany).
| unit: 'W', capability?A value with its unit, scaled, written the region's way: 1820 | unit: 'W' → "1.82 kW" ("1,82 kW" in the Netherlands).
| temp: decimalsA temperature with a degree sign, with the region's decimal mark: 21.46 | temp → "21.5°" ("21,5°" in the Netherlands).
| t: name: valueA text of the widget's Messages in the viewer's language: 'battery_low' | t: level: 82.
| on_offtrue or false as "On" or "Off", in the viewer's language.
| relative_timeA time as how long ago, in the viewer's language: cap.onoff.lastUpdated | relative_time → "4 min ago".
| quotePuts a value into a handler as one quoted text, so it can never add steps.
| durationSeconds as a duration, in the viewer's language: 5400 | duration → "1 h 30 min".
| parse_jsonJSON text (a text variable a flow fills) as values to walk: variables['…'].value | parse_json; nil when it isn't JSON.
| default: valueThe value, or this one when it is empty, false or null.
| append: 'text'Adds text after it.
| prepend: 'text'Adds text before it.
| upcaseIn capitals.
| downcaseIn small letters.
| capitalizeWith a capital first letter.
| truncate: lengthCut to this many characters, ending in “...”.
| replace: 'a', 'b'Every a replaced with b.
| remove: 'text'Every occurrence of the text taken out.
| stripWithout spaces at its start and end.
| split: ','Text cut into a list at each separator.
| join: ', 'A list as one text, joined with the separator.
| sizeHow many items a list has, or characters a text.
| firstThe first item of a list.
| lastThe last item of a list.
| sortA list sorted.
| map: 'key'Each item’s key, as a list.
| where: 'key', valueThe items whose key has that value.
| plus: nAdds a number.
| minus: nTakes a number off.
| times: nMultiplied by a number.
| divided_by: nDivided by a number (whole numbers stay whole).
| modulo: nWhat is left after dividing by a number.
| absWithout its minus sign.
| ceilRounded up to a whole number.
| floorRounded down to a whole number.
| at_least: nThis number at the least.
| at_most: nThis number at the most.
| date: '%H:%M'A time written out: %H:%M is 14:05, %a %e %b is Fri 9 Oct.
| escapeHTML characters escaped (output is escaped anyway).
| url_encodeMade safe for a link’s address.
| jsonA value as JSON text, for a chart’s data attribute: data="{{ list | json }}".