math

A typical arithmetic operation operates on two numbers

1
{{$math [value] [operator] [value]}}
Example
format JSON XML
HTML
1
2
3
4
5
6
{
"Rocket": {
"mass": 50.5,
"acceleration": 3.2
}
}
Code
1
Force: {{$math Rocket.mass "*" Rocket.acceleration}}
Result
HTML
1
<Rocket mass=50.5 acceleration=3.2></Rocket>
Code
1
Force: {{$math Rocket.mass "*" Rocket.acceleration}}
Result

Params

1
2
3
4
5
{{$math
first_value
"operator"
second_value
}}

Operators

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Addition
{{$math 2 "+" 2}} // 4
// Subtraction
{{$math 2 "-" 2}} // 0
// Multiplication
{{$math 2 "*" 2}} // 2
// Division
{{$math 2 "/" 2}} // 1
// Modulus
{{$math 2 "%" 2}} // 0