These helpers provide the ability to perform some calculations within a template.
- Helpers.Math.Add
- Helpers.Math.Ceiling
- Helpers.Math.Divide
- Helpers.Math.Floor
- Helpers.Math.Mod
- Helpers.Math.Multiply
- Helpers.Math.Round
- Helpers.Math.Subtract
| Summary | Add two numbers |
| Returns | Sum of inputs |
| Remarks | |
| Parameters | |
| input1 | First input |
| input2 | Second input |
Context
{
"a": 1,
"b": 2,
"c": 3
}Usage
Returns
<strong>result:</strong>
3
5
7
9| Summary | Rounds input up to the nearest whole number |
| Returns | Ceiling of input |
| Remarks | |
| Parameters | |
| input | input |
Context
{
"a": 1.23,
"b": 2.45,
"c": 3.67
}Usage
Returns
<strong>result:</strong>
2
3
4
5| Summary | Divide first input by second input |
| Returns | Result of first input divided by second input |
| Remarks | |
| Parameters | |
| input1 | First input |
| input2 | Second input |
Context
{
"a": 1,
"b": 2,
"c": 3
}Usage
Returns
<strong>result:</strong>
0.5
0.666666666666667
0.75
0.8| Summary | Rounds input down to the nearest whole number |
| Returns | Floor of input |
| Remarks | |
| Parameters | |
| input | input |
Context
{
"a": 1.23,
"b": 2.45,
"c": 3.67
}Usage
Returns
<strong>result:</strong>
1
2
3
4| Summary | Modulus of first over second input |
| Returns | Result of modulus of first input over second input |
| Remarks | |
| Parameters | |
| input1 | First input |
| input2 | Second input |
Context
{
"a": 1,
"b": 2,
"c": 3
}Usage
Returns
<strong>result:</strong>
1
2
3
4| Summary | Multiply first input by second input |
| Returns | Result of multiplication of first input and second input |
| Remarks | |
| Parameters | |
| input1 | First input |
| input2 | Second input |
Context
{
"a": 1,
"b": 2,
"c": 3
}Usage
Returns
<strong>result:</strong>
2
6
12
20| Summary | Rounds input to the nearest whole number |
| Returns | Rounded input |
| Remarks | Rounds depending on what side of the half the number falls on |
| Parameters | |
| input | input |
Context
{
"a": 1.23,
"b": 2.45,
"c": 3.67
}Usage
Returns
<strong>result:</strong>
1
2
4
5| Summary | Subtract second input from first |
| Returns | Result of subtracting the second input from first |
| Remarks | |
| Parameters | |
| input1 | First input |
| input2 | Second input |
Context
{
"a": 4,
"b": 3,
"c": 1
}Usage
Returns
<strong>result:</strong>
1
2
-1
-3