Skip to main content

Divide

This formula allows you to perform an arithmetic division among numbers.

Returns

integer | decimal

JSON Format

{
"type": "divide",
"components": ...,
"rounding_method": ...
}

RPG Script

This component can be written in RPG Script as:

divide(...)

Note: If your JSON uses rounding_method, make sure your RPG Script form preserves it (e.g. a dedicated helper/function or syntax your DSL supports), so it doesn't silently become plain /.

Fields

FieldTypeRequiredDescription
componentsStatFormulaComponentThe formula for the list of numbers that should be divided. This list should have at least 2 numbers. The first number will be divided by the second number. If the list has more numbers in it, the result of that first division will be divided by the third number in the list, and so on. e.g: [20, 2, 5] will evaluate to 2, since 20 / 2 = 10 and 10 / 5 = 2.
@type array<integer | decimal>
rounding_methodRoundingMethodThe rounding method to be used for the operation.