Constructor and Description |
---|
NumberFormat()
Creates object that enable language sensitive number formatting, using the defualt locale.
|
NumberFormat(CLocale locale)
Creates object that enable language sensitive number formatting, using the locale options.
|
NumberFormat(CLocale locale,
NumberFormatOptions options)
Creates object that enables language sensitive number formatting, using the locale options and specific options.
|
Modifier and Type | Method and Description |
---|---|
String |
format(double value)
Formats a number according to the locale and formatting options of this object.
|
String |
format(T value)
Formats a value according to the locale and formatting options of this object.
|
List<FormatPart> |
formatToParts(double value)
Returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preserving the locale-specific parts.
It is useful for custom formatting of number strings. |
List<FormatPart> |
formatToParts(T value)
Returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preserving the locale-specific parts.
It is useful for custom formatting of value strings. |
CLocale |
getLocale()
Returns the locale which has initialized the format.
|
R |
resolvedOptions()
Returns a new object with properties reflecting the locale and value formatting options computed during initialization of this object.
|
public NumberFormat()
public NumberFormat(CLocale locale)
locale
- a locale instancepublic NumberFormat(CLocale locale, NumberFormatOptions options)
locale
- a locale instanceoptions
- options to configure the number formatpublic final String format(double value)
value
- the number to formatpublic final List<FormatPart> formatToParts(double value)
value
- number to formatpublic final CLocale getLocale()
public final String format(T value)
value
- the vale to formatpublic final R resolvedOptions()
public final List<FormatPart> formatToParts(T value)
value
- value to format