December 1999
Intermediate to advanced
816 pages
20h 27m
English
public class
ChoiceFormat
extends NumberFormat

The ChoiceFormat class is useful for formatting a range of numbers. It is often used in a MessageFormat for dealing with plurals. The choices are specified with a list of doubles in ascending order. The ChoiceFormat class differs from the other formatting classes in this package because it requires the use of a constructor, rather than a factory method, such as getInstance(). A ChoiceFormat is specified with two formats: limits and values. Here's a short code snippet that you could make part of a program:
double[] limitArray = { 1,2,3,4,5,6}; String[] formatArray ...Read now
Unlock full access