API

Class MathTools

Useful math functions

Index
DefaultRoundingPrecision: number = 100

Default rounding precision for GUI elements. It should be set to a power of ten, where the exponent means the number of decimal digits to round to, i.e, 100 means 2 decimal digits, 1000 means 3 decimal digits, etc. Default is 100 (2 decimal digits).

  • Rounds a number to the nearest multiple of a given precision

    Parameters

    • value: number

      the value to be rounded

    • precision: number = MathTools.DefaultRoundingPrecision

      the multiple to which the value will be rounded. Default is 100 (2 decimal digits)

    Returns number