Math

MSK.Math.Number

Generates a random number.

Parameters length - number - The Length of the number

Returns number - number - The Number of the given length

local number = MSK.Math.Number(length)

-- Example
local number = MSK.Math.Number(3) -- Output: 123 or 475 or 285 or ...

-- As an Export:
local number = exports.msk_core:GetRandomNumber(length)

MSK.Math.Round

Rounds a number

Parameters number - number - The Number that should be rounded decimal - number - The Length of the decimal digits

Returns num - number - The rounded number

local num = MSK.Math.Round(number, decimal)

-- Example
local num = MSK.Math.Round(25.8385) -- Output: 26
local num = MSK.Math.Round(25.8385, 1) -- Output: 25.8
local num = MSK.Math.Round(25.8385, 2) -- Output: 25.84

-- As an Export:
local num = exports.msk_core:Round(length)

MSK.Math.Comma

Let your Number look like 1.000 f.e. for UIs, etc.

Parameters number - number - The Number that should be seperated tag - string - Optional

Returns text - string - The sperated text

Last updated