formula: add indexOf (#431)

This commit is contained in:
jean-emmanuel 2018-11-15 07:39:38 +01:00
parent 09ef265a69
commit ded65869db
3 changed files with 4 additions and 0 deletions

View file

@ -78,6 +78,7 @@ Where FORMULA is a valid [MathJS](http://mathjs.org/docs/expressions/syntax.html
Additionnal functions:
- `indexOf(a, x)`: returns index of item `x` in array `a`
- `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