Options
All
  • Public
  • Public/Protected
  • All
Menu

Base formatter implementation that applies raw culture information formatting to a numeric value.

Type parameters

  • T

    The type of the options container.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private baseOptions_

baseOptions_: T

Protected decorationFormatter

decorationFormatter: DecorationFormatter<T>

Protected formatInfo

formatInfo: NumberFormatInfo

Private optionsProviderConstructor_

optionsProviderConstructor_: object

Type declaration

Private optionsProvider_

optionsProvider_: OptionsProvider<T>

Protected resolvedOptions

resolvedOptions: T

Private value_

value_: number

Methods

Private applyDecimalFormat_

  • applyDecimalFormat_(): string

Protected applyOptions

  • applyOptions(value: number): string

Private cleanup_

  • cleanup_(): void

format

  • format(format: string, value: number): string
  • Converts the number to an equivalent string representation using specified format and culture formatting information.

    Parameters

    • format: string

      A format string containing formatting specifications.

    • value: number

      The number to format.

    Returns string

    The formatted numeric value.

Private innerFormat_

  • innerFormat_(format: string, value: number): string

Private setValue_

  • setValue_(value: number): void

Object literals

Private formatters_

formatters_: object

currency

  • currency(): string

decimal

  • decimal(): string

exponential

  • exponential(): string

fixedPoint

  • fixedPoint(): string

general

  • general(): string
  • The general format converts a number to the most compact of either fixed-point or scientific notation, depending on the type of the number and whether a precision specifier is present. Fixed-point notation is used if the exponent that would result from expressing the number in scientific notation is greater than -5 and less than the precision specifier; otherwise, scientific notation is used.

    Returns string

hex

  • hex(): string

number

  • number(): string
  • The numeric format converts a number to a string of the form "-d,ddd,ddd.ddd…", where "-" indicates a negative number symbol if required, "d" indicates a digit (0-9), "," indicates a group separator, and "." indicates a decimal point symbol.

    Returns string

percent

  • percent(): string

roundTrip

  • roundTrip(): string

Generated using TypeDoc