$round

Rounds a floating-point number to the nearest unit.

Usage

$round[number;unit]

This function has two fields.

FieldDescriptionTypeRequired

number

The number to round.

Number

Yes

unit

Amount of decimals to leave.

Integer

Yes

Examples

Example #1

bot.commands.add({
    type: "basicCommand",
    name: "example",
    code: `$round[10.5836763;0]` //Returns 11
})

Example #2

bot.commands.add({
    type: "basicCommand",
    name: "example",
    code: `$round[10.5836763;1]` //Returns 10.6
})

Example #3

bot.commands.add({
    type: "basicCommand",
    name: "example",
    code: `$round[1000.389;2]` //Returns 1000.39
})

Last updated