use round braces
Code Block |
---|
|
{{toFixed (div data.vsysCurrent_mV 1000) 1}} |
date
Format a given time and date.
{{date <date> [format]}}
date
must be a valid input for moment(). When using timestamps it must be in milliseconds.format
Optional parameter, not supported for CSV export. Deprecated: Please use the named parameter (see below).- Optional Named parameters:
Example
Code Block |
---|
|
{{date data.time}}
//Example with optional params
{{date data.time format='dddd, MMMM Do YYYY, h:mm:ss a' tz='Europe/Berlin'}} |
Code Block |
---|
|
{
"data": {
"time": 1585823609000
}
} |
Code Block |
---|
|
02.04.2020 10:33:29 |
duration
Format given duration.
{{duration <duration> [format]}}
Example
Code Block |
---|
|
{{duration duration}} |
Code Block |
---|
|
{
"data": {
"duration": 10000
}
} |
durationHumanize
Format a given duration in a human readable format.
{{durationHumanize <duration>}}
duration
must be a valid input for moment.duration(). When using timestamps it must be in milliseconds.
Example
Code Block |
---|
|
{{durationHumanize data.duration}} |
Code Block |
---|
|
{
"data": {
"duration": 10000
}
} |
durationAs
Get a given duration in a certain unit of time.
{{durationAs <duration> [unit_of_time]}}
Example
Code Block |
---|
|
{{durationAs data.duration "milliseconds"}} |
Code Block |
---|
|
{
"data": {
"duration": 10000
}
} |
fromNow
Display the time between now and a given time. See also: moment().fromNow().
{{fromNow <date>}}
date
must be a valid input for moment(). When using timestamps it must be in milliseconds.
Example
Code Block |
---|
|
{{fromNow data.time}} |
Code Block |
---|
|
{
"data": {
"time": 1585823609000
}
} |
typeof
Display the js type of a value. Useful for debugging.
{{typeof <value>}}
date
must be a valid input for moment(). When using timestamps it must be in milliseconds.
Example
Code Block |
---|
|
{{typeof data.value}} |
Code Block |
---|
|
{
"data": {
"value": 1337
}
} |
toFixed (number of decimals)
Display a number with given amount of decimal places. For more advanced formatting see numberFormat
.
{{toFixed <value> [decimals]}}
decimals
number of decimal places (Default: 2)
Example
Code Block |
---|
|
{{toFixed data.value 3}} |
Code Block |
---|
|
{
"data": {
"value": 1.2345
}
} |
Format a number.
{{numberFormat <value> [options]}}
options:
thousandsSep
separator between 3 digits (Default: locale dependent - ',' for germans)decimalSep
decimal separator (Default: locale dependent - '.' for germans)decimals
number of decimal places (Default: 2)
Example
Code Block |
---|
|
{{numberFormat data.value thousandsSep="." decimalSep=","}} |
Code Block |
---|
|
{
"data": {
"value": 1024.2345
}
} |
Format an array as CSV string.
{{csv <value> [options]}}
options:
- separator separator between entries (Default: ';')
decimalSep
decimal separator (Default: locale dependent - '.' for germans))
Example
Code Block |
---|
|
{{csv data.value separator=";" decimalSep=","}} |
Code Block |
---|
|
{
"data": {
"value": [1024.2345, 5]
}
} |
replace
Replaces a part of a string by an alternativ. Use "" as replaceWith to delete searched part. Will return the input when applied on values that are not of type string.
{{replace "String to search in" "searchFor" "replaceWith"}}
Example
Code Block |
---|
//use
{{replace "Hallo Lobaro welcome to the Internet" "Lobaro" "oraboL"}}
output: "Hallo oraboL welcome to the Internet"
//for a data field in json object
{{replace data.value "wmbusapp-" ""}}
//object to apply:
{
"data": {
"value": "wmbusapp-v101"
}
}
//output
"v101"
|
Math
Mathematical operations.
{{ceil <value>}}
round up to integer{{floor <value>}}
round down to integer{{div <nom> <denom>}}
returns nom / denom{{mul <a> <b>}}
returns a * b (requires Platform > v1.8.0){{max <list> [property_path]}}
returns the biggest element from the list. Compares the given property_path
.
Boolean operations
Boolean operations, useful for #if
conditions.
{{not <value>}}
negate the value{{eq <v1> <v2>}}
v1 == v2{{lt <v1> <v2>}}
v1 < v2{{lte <v1> <v2>}}
v1 <= v2{{gt <v1> <v2>}}
v1 > v2{{gte <v1> <v2>}}
v1 >= v2
Code Block |
---|
|
{{#if (not value)}}
{{value}} is falsy
{{else}}
{{value}} is truthy
{{/if}} |
If Clauses
See also: https://handlebarsjs.com/guide/builtin-helpers.html
Code Block |
---|
{{#if value}}
{{value}} is truthy
{{else}}
{{value}} is falsey
{{/if}}
|
Example, don't return "NaN": {{#if (not (eq data.value NaN))}}{{data.value}}{{/if}}
icon
Render an Icon
{{icon <name> [category]}}
name
name of the icon. Find all icons here: SLDS Iconscategory
category of the icon (Default: "utility").
Device
confi
{{config }}