Class Format

Formatting utilities

Hierarchy

  • Format

Constructors

Properties

currency: string = "€"

Currency to use

dateFormat: string = "d-m-Y"

Date format when using date formatting functions

decimalSeparator: string = "."

Decimal separator when using number formatting functions

escapeHTML: ((str) => string) = ...

Type declaration

    • (str): string
    • Escape a HTML string for safely inserting it in the DOM tree

      Parameters

      • str: string

      Returns string

thousandsSeparator: ","

Thousands separator when using number formatting functions

timeFormat: string = "G:i"

Time format when using time formatting functions

timezone: Timezone = ...

Timezone when using time format functions

Methods

  • Format a date to a string

    Parameters

    Returns string

  • Formats a date and time to the default format

    Parameters

    Returns string

    See

    • Format.dateFormat
    • Format.timeFormat
  • Parameters

    • value: number
    • zeroPad: boolean = false

    Returns string

  • Parameters

    • timeStr: string

    Returns number

  • Format a number to money

    Parameters

    • amount: number

    Returns string

  • Format a number to a localized string

    Parameters

    • value: number
    • decimals: number = 2

    Returns string

  • Format a time to a string

    Parameters

    Returns string

Generated using TypeDoc