Math & Text
multi
$multi[]
The function $multi[] multiplies all the values passed to it, in order. It needs at least 1 argument and has no upper limit.
Important Note: This function is purely mathematical. For conditional branching, use
$if[],$elseif[], and$else[].
Syntax
$multi[value1;(value2;...)]
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value1 |
number | Yes | The first number. |
value2;... |
number | No | Further numbers separated by ; (no upper limit). |
Behavior
- Returns the product of all values.
$multi[2;3;4]→24. - Integers are multiplied exactly (arbitrary size). If a decimal number is involved, the multiplication is done on decimals.
- A value that is not a finite number (text, empty) raises the error “Expected a finite number in argument N.”.
- With a single number the result is that number (rounded to an integer unless
$enableDecimals[yes]):$multi[5]→5,$multi[2.5]→3. The number is still checked and at least one is required ($multi[]raises “Expected a finite number in argument 1.”). - Unless decimals are enabled with
$enableDecimals, a non-integer result is rounded to the nearest integer ($multi[1.5;1.5]→2). - If any argument is
0, the result is0.
Examples
Multiplication Calculation
$title[Math: Multiplication]
$description[Result of `6 * 7`: **$multi[6;7]**]
$addField[Decimal Multiply;$multi[2.5;4];yes]
$addField[Negative Multiply;$multi[-3;5];yes]
$color[#5865F2]
Notes
- Use
$enableDecimals[yes]to keep decimal results. - For more complex operations, use
$calculate[]. - The separator is the semicolon
;.
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.