Skip to main content

Mod

This formula allows you to perform an arithmetic division among numbers, resulting in the division's remainder.

Returns

integer | decimal

JSON Format

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

RPG Script

This component can be written in RPG Script as:

a % b

Fields

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