Main Page | Packages | Class Tree | Index | Help

xp.util

class NumberFormat

Object
  |
  +--xp.util.NumberFormat


class NumberFormat
extends Object

Number Format - a class for formatting Number types


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Field Summary

public static
CURRENCYSTYLE: Number
constants for common formats - currency

public
currencySymbol: String


public static
DEFAULT: Number
constants for common formats - default(NUmber)

public
groupingSize: Number


public
groupingUsed: Boolean


public static
INTEGERSTYLE: Number
constants for common formats - integer

public
isCurrencyFormat: Boolean


public
maxFractionDigits: Number


public
maxIntegerDigits: Number


public
minFractionDigits: Number


public
minIntegerDigits: Number


public
multiplier: Number


public
negPrefix: String


public
negSuffix: String


public static
NUMBERSTYLE: Number
constants for common formats - number

public
parseIntOnly: Boolean


public static
PERCENTSTYLE: Number
constants for common formats - percent

public
posPrefix: String


public
posSuffix: String


public static
SCIENTIFICSTYLE: Number
constants for common formats -scientific

public
showDecimalSeparator: Boolean


Constructor

public
NumberFormat ( )


Method Summary

public
applyPattern ( pattern: String )
Applies the given pattern string to this format instance

public
format ( value: Number ): String
Formats a Number into a string

public static
getCurrencyInstance ( aLocale: Locale )
Returns a currency format for the current default locale.

public static
getInstance ( aLocale: Locale, style: Number )
Returns the default number format for the current default locale

public static
getIntegerInstance ( aLocale: Locale )
Returns the default number format for the specified locale

public static
getNumberInstance ( aLocale: Locale )
Returns a general-purpose number format for the specified locale

public static
getPercentInstance ( aLocale: Locale )
Returns a percentage format for the specified locale.

public
parse ( value: String ): Number
Parses text from the beginning of the given string to produce a number



Field Documentation

CURRENCYSTYLE

public static var CURRENCYSTYLE: Number
constants for common formats - currency

currencySymbol

public var currencySymbol: String

DEFAULT

public static var DEFAULT: Number
constants for common formats - default(NUmber)

groupingSize

public var groupingSize: Number

groupingUsed

public var groupingUsed: Boolean

INTEGERSTYLE

public static var INTEGERSTYLE: Number
constants for common formats - integer

isCurrencyFormat

public var isCurrencyFormat: Boolean

maxFractionDigits

public var maxFractionDigits: Number

maxIntegerDigits

public var maxIntegerDigits: Number

minFractionDigits

public var minFractionDigits: Number

minIntegerDigits

public var minIntegerDigits: Number

multiplier

public var multiplier: Number

negPrefix

public var negPrefix: String

negSuffix

public var negSuffix: String

NUMBERSTYLE

public static var NUMBERSTYLE: Number
constants for common formats - number

parseIntOnly

public var parseIntOnly: Boolean

PERCENTSTYLE

public static var PERCENTSTYLE: Number
constants for common formats - percent

posPrefix

public var posPrefix: String

posSuffix

public var posSuffix: String

SCIENTIFICSTYLE

public static var SCIENTIFICSTYLE: Number
constants for common formats -scientific

showDecimalSeparator

public var showDecimalSeparator: Boolean

Constructor Documentation

NumberFormat

public function NumberFormat()
Creates a NumberFormat NumberFormat() Creates a NumberFormat using the default pattern and symbols for the default locale. NumberFormat(pattern:String) Creates a NumberFormat using the given pattern and the symbols for the default locale. NumberFormat(pattern:String, symbols:NumberSymbols) Creates a NumberFormat using the given pattern and symbols.


Method Documentation

applyPattern

public function applyPattern(pattern: String)
Applies the given pattern string to this format instance

Applies the given pattern string to this format.

Parameters:
pattern
- the new number pattern for this format

format

public function format(value: Number): String
Formats a Number into a string

- Formats a Number into a string

Parameters:
value
- the Number value to be formatted into a string.
Returns:
the formatted string.

getCurrencyInstance

public static function getCurrencyInstance(aLocale: Locale)
Returns a currency format for the current default locale.

Parameters:
aLocale
- the locale for which a number format is needed, uses default locale if not specified
Returns:
a number format for currency values

getInstance

public static function getInstance(aLocale: Locale,
 style: Number)
Returns the default number format for the current default locale

Parameters:
aLocale
- the locale for which a number format is needed, uses default locale if not specified
style
Returns:
a number format

getIntegerInstance

public static function getIntegerInstance(aLocale: Locale)
Returns the default number format for the specified locale

Parameters:
aLocale
- the locale for which a number format is needed, uses default locale if not specified
Returns:
a number format for integer values

getNumberInstance

public static function getNumberInstance(aLocale: Locale)
Returns a general-purpose number format for the specified locale

Parameters:
aLocale
- the locale for which a number format is needed, uses default locale if not specified
Returns:
a number format for number values

getPercentInstance

public static function getPercentInstance(aLocale: Locale)
Returns a percentage format for the specified locale.

Parameters:
aLocale
- the locale for which a number format is needed, uses default locale if not specified
Returns:
a number format for percent values

parse

public function parse(value: String): Number
Parses text from the beginning of the given string to produce a number

- Parses text from the beginning of the given string to produce a number. The method may not use the entire text of the given string.

Parameters:
value
- A String whose beginning should be parsed
Returns:
A Number parsed from the string


The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc