Callable

  • Parameters

    Returns string

Index

Type aliases

CustomFormat

CustomFormat: object

Type declaration

  • dotIndex: number
  • effectiveNumbersAfterDot: number
  • effectiveNumbersBeforeDot: number
  • expIndex: number
  • numbersAfterDot: number
  • numbersBeforeDot: number
  • scaling: number
  • tokens: CustomFormatElement[]
  • useGroupSeparators: boolean

CustomFormatElement

CustomFormatElement: object

Type declaration

  • token: string
  • type: typeof SpecifierToken | typeof TextToken

Variables

Const SpecifierToken

SpecifierToken: 1 = 1

Const TextToken

TextToken: 2 = 2

Const customFormatRegexp

customFormatRegexp: RegExp = /'(?:[^']|\\')*'|"(?:[^"]|\\")*"|['"]|\\.|0|#|\.|,|%|‰|[Ee][+-]?0+|(.)/g

Functions

currencyFormat

  • currencyFormat(value: number, precision?: number, info?: NumberFormatInfo): string
  • Parameters

    Returns string

customFormat

decimalFormat

  • decimalFormat(value: number, precision?: number, info?: NumberFormatInfo): string
  • Parameters

    Returns string

exponentialFormat

  • exponentialFormat(value: number, precision?: number, isUpper?: boolean, info?: NumberFormatInfo, minExpDigits?: number): string
  • Parameters

    • value: number
    • Optional precision: number
    • Optional isUpper: boolean
    • Optional info: NumberFormatInfo
    • Default value minExpDigits: number = 3

    Returns string

fixedPointFormat

  • fixedPointFormat(value: number, precision?: number, info?: NumberFormatInfo): string
  • Parameters

    Returns string

generalFormat

  • generalFormat(value: number, precision?: number, isUpper?: boolean, info?: NumberFormatInfo): string
  • Parameters

    • value: number
    • Optional precision: number
    • Optional isUpper: boolean
    • Optional info: NumberFormatInfo

    Returns string

getFixedPointNumberParts

  • getFixedPointNumberParts(value: number, precision: number, negativeSign?: string): string[]
  • Parameters

    • value: number
    • precision: number
    • Optional negativeSign: string

    Returns string[]

hexadecimalFormat

  • hexadecimalFormat(value: number, precision?: number, isUpper?: boolean): string
  • Parameters

    • value: number
    • Optional precision: number
    • Optional isUpper: boolean

    Returns string

normalizeForFormat

numericFormat

  • numericFormat(value: number, precision?: number, info?: NumberFormatInfo): string
  • Parameters

    Returns string

parseCustomFormatString

  • parseCustomFormatString(format: string): object
  • Parameters

    • format: string

    Returns object

    • dotIndex: number
    • effectiveNumbersAfterDot: number
    • effectiveNumbersBeforeDot: number
    • expIndex: number
    • numbersAfterDot: number
    • numbersBeforeDot: number
    • scaling: number
    • tokens: CustomFormatElement[]
    • useGroupSeparators: boolean

percentFormat

  • percentFormat(value: number, precision?: number, info?: NumberFormatInfo): string
  • Parameters

    Returns string

placeCurrencyValue

  • placeCurrencyValue(value: string, isPositive: boolean, negativeSign: string, currencySymbol: string, patternNumber: number): string
  • Parameters

    • value: string
    • isPositive: boolean
    • negativeSign: string
    • currencySymbol: string
    • patternNumber: number

    Returns string

Const roundNumber

  • roundNumber(v: number, s: number): number
  • Parameters

    • v: number
    • s: number

    Returns number

roundTripFormat

seemsToBeZero

  • seemsToBeZero(intPart: string, fraction: string): boolean
  • Parameters

    • intPart: string
    • fraction: string

    Returns boolean

splitToGroups

  • splitToGroups(intPart: string, groupSeparator?: string, groupSizes?: number[]): string
  • Parameters

    • intPart: string
    • Optional groupSeparator: string
    • Optional groupSizes: number[]

    Returns string

splitToGroupsArray

  • splitToGroupsArray(intPart: string, groupSizes?: number[]): string[]
  • Parameters

    • intPart: string
    • Optional groupSizes: number[]

    Returns string[]

trimTrailingZeros

  • trimTrailingZeros(value: string, decimalSeparator: string): string
  • Parameters

    • value: string
    • decimalSeparator: string

    Returns string

Generated using TypeDoc