When creating discounts and surcharges, you define a formula to calculate the amount. The system automatically calculates this amount when the order is placed. The amount should be negative for discounts and positive for surcharges. The formula can return either an absolute value (in currency) or a percentage of the cost. Most importantly, a formula can include parameters and functions.
In the formula, you can use reservation parameters. Parameters must be enclosed in square brackets. For example: 100 * [PARAMETER].
To add parameters, click the Insert parameter button.
Then select the parameter you need.
The parameter name will be generated automatically, but you can change it if you wish. After you click Insert, the parameter will be added to the formula.
The parameters used in the formula represent the number of shares, not the price. For example, this could be the number of tickets booked for a children's fare.
For price options that cover the whole resource, the parameter is set to 1 if the price option is reserved in the order. Otherwise, the parameter will be 0.
The Number field is passed to the formula as a number. The Checkbox field is passed as 1 if it is selected on the form; otherwise, it is 0.
You can also use the [STEPS] parameter. This equals the number of reserved steps, such as hours for hourly rentals. Additionally, you can set this parameter separately for each rule. These options are available only if the resource type is rental.
In addition to standard arithmetic operations, you can use the following functions. To add a function, click the Insert function button.
Select the required function from the list.
The selected function will be inserted into the formula immediately.

The list of functions:
- Abs([X]) returns the absolute value of a number.
Example: Abs(-2) = 2. - Ceiling([X]) rounds a number up to the nearest integer.
Example: Ceiling(7.23) = 8. - Floor([X]) rounds a number down to the nearest integer.
Example: Floor(4.75) = 4. - Max([X],[Y]) returns the larger of two numbers.
Example: Max(7,8) = 8. - Min([X],[Y]) returns the smaller of two numbers.
Example: Min(7,8) = 7. - Pow([X],2) raises the first number to the power of the second.
Example: Pow(3,2) = 9. - Round([X]) rounds a number to the nearest integer.
Example: Round(3.45) = 3. - Round([X],2) rounds a number to a specified number of decimal places.
Example: Round(3.4576,2) = 3.46. - Sign([X]) returns -1 for negative numbers and 1 for positive numbers.
Example: Sign(-99) = -1. - Sqrt([X],2) calculates the square root.
Example: Sqrt(4) = 2. - Truncate([X]) removes the fractional part of a number.
Example: Truncate(15.7) = 15. - if([CONDITION], [X], [Y]) evaluates the condition and returns [X] if it is true; otherwise, it returns [Y]. In the condition, you can use these operators: >, >=, =, <, <=, <>, or, and.
Example: if([STEPS] > 5, 100, 200) = 100 for six reserved intervals. - in([X], 1, 2, 3..) checks whether the number is in the sequence. The result can be used in the condition of the if function.
Example: in(7,1,7,8) = true.
The system also supports trigonometric and other functions: Sin([X]), Cos([X]), Tan([X]), Log([X],[Y]), Log10([X]), Exp([X]), Asin([X]), Acos([X]), Atan([X]), IEEERemainder([X],[Y]).