# Description

The **CalcGen Generator** calculates the result of an equation using up to five variables. Variables can either be constant values or references to other Attributes.

**Example Equations: **

- var1 + var2
- (var2 / 15) - var3 + 3 * (var1)
- (var4 * var3) / var5 - var2 + var1

**Example Variables:**

- 3
- #{test.value1}

## Parameter

The following parameters may be configured for the CalcGen Generator. Items with an asterisk* are required.

**equation***- The math equation to be evaluated.**numberFormat***- Defines how the generated number will be formatted. Examples: 0, 0.00. #.00, #,##.00, $#,##0.00.**var1**- The first of five possible variables to use in the equation.**var2**- The second of five possible variables to use in the equation.**var3**- The third of five possible variables to use in the equation.**var4**- The fourth of five possible variables to use in the equation.**var5**- The fifth of five possible variables to use in the equation.

## Example 1: Using an Equation to Add to Values: Regular Pay and Overtime Pay

For this example, five Attributes have been added to calculate the regular pay, overtime pay, and total pay for individuals.

**fullName**- Generates the full name of a person.**hours**- Generates work hours ranging from 1 to 80.**regularPay**- Generates regular pay based on the number of hours worked.**overtimePay**- Generates overtime pay based o the number of hours worked.**totalPay**- Adds the values generated for regular pay and overtime pay.

### hours Configuration

The **RandomGen Generator** has been configured for the hours Attribute to generate the number of work hours ranging between 1 and 80.

### regularPay Configuration

The **RegularPayGen Generator** is used to configure the regular pay based on the number of worked hours. For this configuration, the hours Attribute is referenced by the hoursWorked Parameter.

### overTime Pay Configuration

The **OvertimePayGen Generator** is used to configure the overtime pay based on the number of hours worked over the standard 40-hour work week. For this configuration, the hours Attribute is referenced by the hoursWorked Parameter.

### totalPay Configuration

The **CalcGen Generator** is used to add the regular pay and overtime pay values together to determine the person's total pay based on hours worked.

For this configuration, the following has been configured:

**equation**= var1+var2**numberFormat**= 0.00**var1**= References regularPay Attribute**var2**= References overtimePay Attrtibute

## Sample Output

## Video Training

The following video can be used to see a quick tutorial on how to use the CalcGen Generator: