Class TariffRate

An identifiable tariff rate.

Remarks

The exponent property can be used to maintain precision in amount. For example an amount of 1.23 could be expressed as 123 with an exponent of -2.

Hierarchy

  • TariffRate

Constructors

  • Constructor.

    Parameters

    • id: string

      the identifier

    • amount: number

      the amount

    • Optional exponent: number

      a base-10 exponent to interpret amount in; if not provided then 0 is assumed

    • Optional description: string

      a description

    Returns TariffRate

Properties

#amount: number
#description: undefined | string
#exponent: number
#id: string

Accessors

  • get amount(): number
  • Get the amount.

    Returns number

  • get description(): undefined | string
  • Get the description.

    Returns undefined | string

  • get exponent(): number
  • Get the exponent.

    Returns number

  • get id(): string
  • Get the identifier.

    Returns string

Methods

  • Get a string representation.

    Returns string

    the string representation

  • Parse locale string values into a TariffRate instance.

    Parameters

    • locale: string

      the locale to parse the amount and exponent string values as

    • id: string

      the identifier

    • amount: string

      the amount, as a number string in the locale locale

    • Optional exponent: string

      a base-10 exponent to interpret amount in, as a number string in the locale locale; if not provided then 0 is assumed

    • Optional description: string

      a description

    Returns TariffRate

    the new instance

    Throws

    TypeError if the amount or exponent can not be parsed as numbers

Generated using TypeDoc