• Format a number using fixed point notation.

    Example

    formatDecimal(1.2345)    // "1.23"
    formatDecimal(1.2345, 3) // "1.235"

    Returns

    Formatted decimal (as string)

    Parameters

    • value: number

      Number to format

    • Optional places: number

      (optional) Number of decimal places to round to (defaults to 2)

    Returns string

  • Parameters

    • value: number
    • Optional options: NumberFormatOptions

    Returns string

Generated using TypeDoc