ChoiceFormat converts between ranges of numeric values and string names for those ranges.
A ChoiceFormat splits the real number line -Inf to +Inf into two or more contiguous ranges. Each range is mapped to a string. ChoiceFormat is generally used in a MessageFormat for displaying grammatically correct plurals such as "There are 2 files."
$string = '[0] are no files |[1] is one file |(1,Inf] are {number} files';
$formatter = new MessageFormat(...); //init for a source