Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DecorationFormatter<T>

Partial formatter implementation that applies decoration options to the resulting value.

Type parameters

  • T

    The type of the options container.

Hierarchy

  • DecorationFormatter

Index

Constructors

constructor

Properties

Private decimalOffset_

decimalOffset_: number

Private formatInfo_

formatInfo_: NumberFormatInfo

Private internalDecorators_

internalDecorators_: Indexable<string>

Private noDigits_

noDigits_: boolean

Private noLeadingZeroIntegerDigit_

noLeadingZeroIntegerDigit_: boolean

Private prefixDecorator_

prefixDecorator_: string

Private restoreNegativeSign_

restoreNegativeSign_: boolean

Private style_

style_: string

Private suffixDecorator_

suffixDecorator_: string

Private upperCase_

upperCase_: boolean

Private useGrouping_

useGrouping_: boolean

Static Private groupSeparatorRegExp_

groupSeparatorRegExp_: RegExp

Methods

Private applyDigitOptions_

  • applyDigitOptions_(value: number, formattedValue: string): string

Private applyExternalDecorators_

  • applyExternalDecorators_(formattedValue: string): string

applyGrouping

  • applyGrouping(formattedValue: string): string
  • Applies the grouping option using the appropriate group separator.

    Parameters

    • formattedValue: string

      The partial resulting format value.

    Returns string

    A resulting format value with the applied grouping option.

applyIntegerPadding

  • applyIntegerPadding(value: number, formattedValue: string, paddingWidth: number): string
  • Applies the minimum integer digits option by padding the numeric part before the decimal separator. Also temporarily removes the current NumberFormatInfo.NegativeSign. It is restored when applyOptions finishes all decoration formatting.

    Parameters

    • value: number

      The number which is currently being formatted.

    • formattedValue: string

      The partial resulting format value.

    • paddingWidth: number

      The number of characters in the resulting numeric string's integral part.

    Returns string

    A resulting format value with the applied minimum integer digits option and without a negative sign.

Private applyInternalDecorator_

  • applyInternalDecorator_(numericParts: string[], index: number, decorator: string): void

Private applyInternalDecorators_

  • applyInternalDecorators_(formattedValue: string): string

Private applyNegativeSign_

  • applyNegativeSign_(value: number, formattedValue: string): string

applyOptions

  • applyOptions(value: number, formattedValue: string): string
  • Applies negative sign position and symbol, removal of the leading zero, internal and external decorators to the formatted value.

    Parameters

    • value: number

      The number which is currently being formatted.

    • formattedValue: string

      The partial resulting format value.

    Returns string

    The fully formatted value.

applyUppercase

  • applyUppercase(formattedValue: string): string
  • Applies the uppercase option for some standard specifiers that require it.

    Parameters

    • formattedValue: string

      The partial resulting format value.

    Returns string

    A resulting format value with the applied uppercase option.

getDecimalSeparator

getGroupSeparator

Private isCurrency_

  • isCurrency_(): boolean

Private removeNegativeSign_

  • removeNegativeSign_(value: number, formattedValue: string): string

Private shouldRemoveLeadingZero_

  • shouldRemoveLeadingZero_(value: number): boolean

Generated using TypeDoc