Zimlet JavaScript API Reference - AjxChoiceFormat

Class AjxChoiceFormat




Defined in: AjxText.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
AjxChoiceFormat(pattern)
Choice formatter typically used to format plurals.
Method Summary
Method Attributes Method Name and Description
 
format(number, index)
Format a number based on the choice pattern.
Class Detail
AjxChoiceFormat(pattern)
Choice formatter typically used to format plurals. This class is modeled after Java's ChoiceFormat.

The arguments passed to this constructor can be either:

  • A single argument that represents a string pattern that specifies the limits and formats separated by pipe characters (|).
  • Two arguments, an array of limits and and array of format patterns.

For complete details, see the JavaDoc for java.text.ChoiceFormat.

Parameters:
{string} pattern
Format pattern.
Method Detail
{string} format(number, index)
Format a number based on the choice pattern.
Parameters:
{number|Array} number
Specifies the number to format. If called from a message segment, this argument is the array of arguments passed to the message formatter.
{number} index
Optional. If called from a message format, this argument is the index into the array that is passed as the first argument. The value at the index in the array is the number to format.
Returns:
{string} The formatted choice.

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:30 GMT-0400 (EDT)