docs/log: math timestamp

This commit is contained in:
jean-emmanuel 2018-08-31 11:16:40 +02:00
parent 1a1920e251
commit 21c59ff446
2 changed files with 6 additions and 2 deletions

View file

@ -14,7 +14,7 @@ Where FORMULA is a valid [MathJS](http://mathjs.org/docs/expressions/syntax.html
- formulas can be [multiline](http://mathjs.org/docs/expressions/syntax.html#multiline-expressions)
- property inheritance calls (`@{...}`) are always resolved before formulas
- arrays / matrices indexes are **zero-based** (ie `["a","b"][0]` returns `"a"`)
- strings can be multiline when enclosed in backticks instead of double quotes (``` ` ` ```)
- strings can be multiline when enclosed in backticks (``` ` ` ```)
- inner closing brackets (`}`) must be escaped with a backslash (`\}`)
Additionnal functions:
@ -22,6 +22,9 @@ Additionnal functions:
- `unpack(x)`: remove an array's brackets (`unpack([1,2])` returns `"1, 2"`)
- `pad(x, padding)`: add leading zeros if the length the integer part of `x` is smaller than `padding` (`pad(1,2)` returns `"01"`)
- `length(x)`: returns the length of an array or string
- `values(x)`: returns an array of a given object's own property values
- `keys(x)`: returns an array of a given object's own property names
- `timestamp()`: returns the number of milliseconds elapsed since January 1, 1970
!!! tip ""
A single widget property can contain multiple formulas. Variables and functions declared in a formula are available to subsequent formulas in the same property definition.