The following table shows you the right operand for various functions you’re likely to use in Document Scripting.

OperandNameExampleResult
+Addition2 + 24
Subtraction2 – 20
*Multiplication2 * 36
/Division12 / 43
**Power2**101024
%Mod12 % 93
&&Boolean andtrue && falsefalse



Boolean or | true || false | true
andBoolean andtrue and falsefalse
orBoolean ortrue or falsetrue
<Less than2Greater than | 2 > 3 | false
!Not!truefalse

Using Document Scripting to perform basic mathematical calculations is fairly straightforward. Here are a couple of examples.

InputOutputNotes
{{ 2 + 2 }}4All of the operands are valid here.
{{ proposal_value.to_i * 10 }}value*10Check out the methods article to find out more about using .to_i.
{{ proposal_value1.to_i + proposal_value2.to_i}}value1 + value2Check out the methods article to find out more about using .to_i.

Convert any proposal_value to an integer prior to performing any math functions with the value.