API Docs for:
Show:

flavors.java.Formatter.number.localize Class

Module: flavors
Parent Module: pat

Java number localization algorithm.

Methods

decimalSeparator

(
  • arg
  • culture
)
static

Java number localization algorithm. If a decimal separator is present, a culture-specific decimal separator is substituted.

Parameters:

  • arg Array

    Character array representing the Number to be localized

  • culture Object

    Culture information

Returns:

undefined

digits

(
  • arg
)
static

Java number localization algorithm. Each digit character d in the string is replaced by a culture-specific digit computed relative to the current culture's zero digit z; that is d - '0' + z.

Parameters:

  • arg Array

    Character array representing the Number to be localized

Returns:

undefined

groupingSeparator

(
  • arg
  • culture
)
static

Java number localization algorithm. If the ',' ('\u002c') flag is given, then the culture-specific grouping separator is inserted by scanning the integer part of the string from least significant to most significant digits and inserting a separator at intervals defined by the culture's grouping size.

Parameters:

  • arg Array

    Character array representing the Number to be localized

  • culture Object

    Culture information

localize

(
  • arg
  • width
  • culture
)
static

Java number localization algorithm. If the '0' flag is given, then the culture-specific zero digits are inserted after the sign character, if any, and before the first non-zero digit, until the length of the string is equal to the requested field width.

Parameters:

  • arg Array

    Character array representing the Number to be localized

  • width Number

    Length of the resulting string

  • culture Object

    Culture information

Returns:

undefined

localizeNumber

(
  • arg
  • culture
  • width
  • options
)
String static

Java localization algorithm for number strings.

Parameters:

  • arg String

    Number string to be localized

  • culture Object

    Culture-specific information

  • width Number

    The result's minimum width

  • options Object

    Localization options (Options of a parsed token)

Returns:

String: The localized number string

sign

(
  • arg
  • opt
)
static

Java flavored number localization algorithm.

If the value is negative and the '(' flag is given, then a '(' is prepended and a ')' is appended.

If the value is negative and '(' flag is not given, then a '-' is prepended.

If the '+' flag is given and the value is positive or zero, then a '+' will be prepended.

If the ' ' flag is given and the value is positive or zero, then a ' ' will be prepended.

Parameters:

  • arg Array

    Character array representing the Number to be localized

  • opt Object

    Sign options

Returns:

undefined

Properties

ASCII_9 ASCII code for '9' (57)

Number final

ASCII_ZERO ASCII code for '0' (48)

Number final