Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Number

Hierarchy

  • Number

Index

Methods

Methods

clamp

  • clamp(min: number, max: number): number
  • Returns a number whose value is limited to the given range.

    method

    Number.prototype.clamp

    Parameters

    • min: number

      The lower boundary

    • max: number

      The upper boundary

    Returns number

    A number in the range (min, max)

mod

  • mod(n: number): number
  • Returns a modulo value which is always positive.

    method

    Number.prototype.mod

    Parameters

    • n: number

      The divisor

    Returns number

    A modulo value

padZero

  • padZero(length: number): string
  • Makes a number string with leading zeros.

    method

    Number.prototype.padZero

    Parameters

    • length: number

      The length of the output string

    Returns string

    A string with leading zeros

Generated using TypeDoc