Locale |
This component enables operations to be performed on the locale related formats by setting or retrieving the specific locale format values.
The following table lists the methods that can be defined for the component:
Method |
Description |
---|---|
Returns the name of the locale |
|
Returns the full name of the locale |
|
Returns the number decimal separator for the corresponding locale |
|
Sets the number decimal separator for the corresponding locale |
|
Returns the number group separator for the corresponding locale |
|
Sets the number group separator for the corresponding locale |
|
Returns the number group sizes for the corresponding locale |
|
Sets the number group sizes for the corresponding locale |
|
Returns the number of decimal digits for the corresponding locale |
|
Sets the number of decimal digits for the corresponding locale |
|
Returns the currency decimal separator for the corresponding locale |
|
Sets the currency decimal separator for the corresponding locale |
|
Returns the currency group separator for the corresponding locale |
|
Sets the currency group separator for the corresponding locale |
|
Returns the currency group sizes for the corresponding locale |
|
Sets the currency group sizes for the corresponding locale |
|
Returns the currency decimal digits for the corresponding locale |
|
Sets the currency decimal digits for the corresponding locale |
|
Returns the currency code for the corresponding locale |
|
Sets the currency code for the corresponding locale |
|
Returns the currency symbol for the corresponding locale |
|
Sets the currency symbol for the corresponding locale |
|
Returns the negative pattern for the number |
|
Sets the negative pattern for the number |
|
Returns the positive pattern for the currency |
|
Sets the positive pattern for the currency |
|
Returns the negative pattern for the currency |
|
Sets the negative pattern for the currency |
|
Returns the month names for the corresponding locale as an array |
|
Sets the month name for the index in the corresponding locale |
|
Returns the month name for the index in the corresponding locale |
|
Sets the month names for the corresponding locale |
|
Returns the abbreviated month names for the corresponding locale |
|
Returns the abbreviated month name in the index for the corresponding locale |
|
Returns the index for the abbreviated month name for the corresponding locale |
|
Sets the abbreviated month names for the corresponding locale |
|
Returns the day names as an array for the corresponding locale |
|
Returns the day name for the index in the corresponding locale |
|
Returns the index for the day name for the corresponding locale |
|
Sets the day names for the corresponding locale |
|
Returns the abbreviated day names for the corresponding locale |
|
Returns the abbreviated day name for the index in the corresponding locale |
|
Returns the index for the abbreviated day name for the corresponding locale |
|
Sets the abbreviated month names for the corresponding locale |
|
Returns the AM designator for the corresponding locale |
|
Sets the AM designator for the corresponding locale |
|
Returns the PM designator for the corresponding locale |
|
Sets the PM designator for the corresponding locale |
|
Returns the short date format for the corresponding locale |
|
Sets the short date format for the corresponding locale |
|
Returns the long date format for the corresponding locale |
|
Sets the long date format for the corresponding locale |
|
Returns the short time format for the corresponding locale |
|
Sets the short time format for the corresponding locale |
|
Returns the long time format for the corresponding locale |
|
Sets the long time format for the corresponding locale |
Static Methods
Method |
Description |
---|---|
Returns the locale object |
Example
This sample displays the use of the Locale library.
var locale = new Locale("en-US"); locale.setDecimalSeparator(","); locale.setGroupSeparator(" "); locale.setNumberGroupSizes("2,3"); var numberFormat = new NumberFormat(); numberFormat.setLocale(locale); numberFormat.format("123504.36");