Options
All
  • Public
  • Public/Protected
  • All
Menu

Common operations and tools related with numbers

Hierarchy

  • NumericUtils

Index

Methods

Static generateRandomInteger

  • generateRandomInteger(min: number, max: number): number
  • Generate a random integer between the specified range (both extremes are included).

    throws

    Exception if max is equal or less than min.

    Parameters

    • min: number

      lowest possible value (negative values are allowed)

    • max: number

      highest possible value (negative values are allowed)

    Returns number

    A random integer value between min and max

Static getNumeric

  • getNumeric(value: any): number
  • Get the number represented by the given value

    Parameters

    • value: any

    Returns number

    number The numeric type representation from the given value. For example, a string '0001' will return 1

Static isInteger

  • isInteger(value: any): boolean
  • Tells if the given value is a numeric integer or not

    Parameters

    • value: any

      A value to check

    Returns boolean

    true if the given value is a numeric integer or represents a a numeric integer value, false otherwise

Static isNumeric

  • isNumeric(value: any): boolean
  • Tells if the given value is numeric or not

    Parameters

    • value: any

      A value to check

    Returns boolean

    true if the given value is numeric or represents a numeric value, false otherwise

Generated using TypeDoc