]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/unicode/choicfmt.h
2 ********************************************************************************
3 * Copyright (C) 1997-2004, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ********************************************************************************
9 * Modification History:
11 * Date Name Description
12 * 02/19/97 aliu Converted from java.
13 * 03/20/97 helena Finished first cut of implementation and got rid
14 * of nextDouble/previousDouble and replaced with
16 * 4/10/97 aliu Clean up. Modified to work on AIX.
17 * 8/6/97 nos Removed overloaded constructor, member var 'buffer'.
18 * 07/22/98 stephen Removed operator!= (implemented in Format)
19 ********************************************************************************
25 #include "unicode/utypes.h"
27 #if !UCONFIG_NO_FORMATTING
29 #include "unicode/unistr.h"
30 #include "unicode/numfmt.h"
31 #include "unicode/fieldpos.h"
32 #include "unicode/format.h"
39 * ChoiceFormat converts between ranges of numeric values
40 * and string names for those ranges. A <code>ChoiceFormat</code> splits
41 * the real number line <code>-Inf</code> to <code>+Inf</code> into two
42 * or more contiguous ranges. Each range is mapped to a
43 * string. <code>ChoiceFormat</code> is generally used in a
44 * <code>MessageFormat</code> for displaying grammatically correct
45 * plurals such as "There are 2 files."</p>
47 * <p>There are two methods of defining a <code>ChoiceFormat</code>; both
48 * are equivalent. The first is by using a string pattern. This is the
49 * preferred method in most cases. The second method is through direct
50 * specification of the arrays that make up the
51 * <code>ChoiceFormat</code>.</p>
53 * <p><strong>Patterns</strong></p>
55 * <p>In most cases, the preferred way to define a
56 * <code>ChoiceFormat</code> is with a pattern. Here is an example of a
57 * <code>ChoiceFormat</code> pattern:</p>
59 * \htmlonly<pre> 0≤are no files|1≤is one file|1<are many files</pre>\endhtmlonly
61 * <p>or equivalently,</p>
63 * <pre> 0#are no files|1#is one file|1<are many files</pre>
65 * <p>The pattern consists of a number or <em>range specifiers</em>
66 * separated by vertical bars '|' (U+007C). There is no
67 * vertical bar after the last range. Each range specifier is of the
70 * \htmlonly<blockquote><em>Number Separator String</em></blockquote>\endhtmlonly
72 * <p><em>Number</em> is a floating point number that can be parsed by a
73 * default <code>NumberFormat</code> for the US locale. It gives the
74 * lower limit of this range. The lower limit is either inclusive or
75 * exclusive, depending on the <em>separator</em>. The upper limit is
76 * given by the lower limit of the next range. The Unicode infinity
77 * sign \htmlonly∞ \endhtmlonly (U+221E) is recognized for positive infinity. It may be preceded by
78 * '-' (U+002D) to indicate negative infinity.</p>
80 * <p><em>String</em> is the format string for this range, with special
81 * characters enclosed in single quotes (<code>'The #
82 * sign'</code>). Single quotes themselves are indicated by two single
83 * quotes in a row (<code>'o''clock'</code>).</p>
85 * <p><em>Separator</em> is one of the following single characters:
88 * <li>\htmlonly'≤' \endhtmlonly (U+2264) or '#' (U+0023)
89 * indicates that the lower limit given by <em>Number</em> is
90 * inclusive. (The two characters are equivalent to ChoiceFormat.)
91 * This means that the limit value <em>Number</em> belongs to this
92 * range. Another way of saying this is that the corresponding
93 * closure is <code>FALSE</code>.</li>
95 * <li>'<' (U+003C) indicates that the lower limit given by
96 * <em>Number</em> is exclusive. This means that the value
97 * <em>Number</em> belongs to the prior range.</li> Another way of
98 * saying this is that the corresponding closure is
102 * <p>See below for more information about closures.</p>
104 * <p><strong>Arrays</strong></p>
106 * <p>A <code>ChoiceFormat</code> defining <code>n</code> intervals
107 * (<code>n</code> >= 2) is specified by three arrays of
108 * <code>n</code> items:
111 * <li><code>double limits[]</code> gives the start of each
112 * interval. This must be a non-decreasing list of values, none of
113 * which may be <code>NaN</code>.</li>
114 * <li><code>UBool closures[]</code> determines whether each limit
115 * value is contained in the interval below it or in the interval
116 * above it. If <code>closures[i]</code> is <code>FALSE</code>, then
117 * <code>limits[i]</code> is a member of interval
118 * <code>i</code>. Otherwise it is a member of interval
119 * <code>i+1</code>. If no closures array is specified, this is
120 * equivalent to having all closures be <code>FALSE</code>. Closures
121 * allow one to specify half-open, open, or closed intervals.</li>
122 * <li><code>UnicodeString formats[]</code> gives the string label
123 * associated with each interval.</li>
126 * <p><strong>Formatting and Parsing</strong></p>
128 * <p>During formatting, a number is converted to a
129 * string. <code>ChoiceFormat</code> accomplishes this by mapping the
130 * number to an interval using the following rule. Given a number
131 * <code>X</code> and and index value <code>j</code> in the range
132 * <code>0..n-1</code>, where <code>n</code> is the number of ranges:</p>
134 * \htmlonly<blockquote>\endhtmlonly<code>X</code> matches <code>j</code> if and only if
135 * <code>limit[j] <= X < limit[j+1]</code>
136 * \htmlonly</blockquote>\endhtmlonly
138 * <p>(This assumes that all closures are <code>FALSE</code>. If some
139 * closures are <code>TRUE</code> then the relations must be changed to
140 * <code><=</code> or <code><</code> as appropriate.) If there is
141 * no match, then either the first or last index is used, depending on
142 * whether the number is too low or too high. Once a number is mapped to
143 * an interval <code>j</code>, the string <code>formats[j]</code> is
146 * <p>During parsing, a string is converted to a
147 * number. <code>ChoiceFormat</code> finds the element
148 * <code>formats[j]</code> equal to the string, and returns
149 * <code>limits[j]</code> as the parsed value.</p>
151 * <p><strong>Notes</strong></p>
153 * <p>The first limit value does not define a range boundary. For
154 * example, in the pattern "<code>1.0#a|2.0#b</code>", the
155 * intervals are [-Inf, 2.0) and [2.0, +Inf]. It appears that the first
156 * interval should be [1.0, 2.0). However, since all values that are too
157 * small are mapped to range zero, the first interval is effectively
158 * [-Inf, 2.0). However, the first limit value <em>is</em> used during
159 * formatting. In this example, <code>parse("a")</code> returns
162 * <p>There are no gaps between intervals and the entire number line is
163 * covered. A <code>ChoiceFormat</code> maps <em>all</em> possible
164 * double values to a finite set of intervals.</p>
166 * <p>The non-number <code>NaN</code> is mapped to interval zero during
169 * <p><strong>Examples</strong></p>
171 * <p>Here is an example of two arrays that map the number
172 * <code>1..7</code> to the English day of the week abbreviations
173 * <code>Sun..Sat</code>. No closures array is given; this is the same as
174 * specifying all closures to be <code>FALSE</code>.</p>
176 * <pre> {1,2,3,4,5,6,7},
177 * {"Sun","Mon","Tue","Wed","Thur","Fri","Sat"}</pre>
179 * <p>Here is an example that maps the ranges [-Inf, 1), [1, 1], and (1,
180 * +Inf] to three strings. That is, the number line is split into three
181 * ranges: x < 1.0, x = 1.0, and x > 1.0.</p>
184 * {FALSE, FALSE, TRUE},
185 * {"no files", "one file", "many files"}</pre>
187 * <p>Here is a simple example that shows formatting and parsing: </p>
190 * #include <unicode/choicfmt.h>
191 * #include <unicode/unistr.h>
192 * #include <iostream.h>
194 * int main(int argc, char *argv[]) {
195 * double limits[] = {1,2,3,4,5,6,7};
196 * UnicodeString monthNames[] = {
197 * "Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
198 * ChoiceFormat fmt(limits, monthNames, 7);
201 * for (double x = 1.0; x <= 8.0; x += 1.0) {
202 * fmt.format(x, str);
203 * str.extract(0, str.length(), buf, 256, "");
205 * cout << x << " -> "
213 * <p>Here is a more complex example using a <code>ChoiceFormat</code>
214 * constructed from a pattern together with a
215 * <code>MessageFormat</code>.</p>
218 * #include <unicode/choicfmt.h>
219 * #include <unicode/msgfmt.h>
220 * #include <unicode/unistr.h>
221 * #include <iostream.h>
223 * int main(int argc, char *argv[]) {
224 * UErrorCode status = U_ZERO_ERROR;
225 * double filelimits[] = {0,1,2};
226 * UnicodeString filepart[] =
227 * {"are no files","is one file","are {0} files"};
228 * ChoiceFormat* fileform = new ChoiceFormat(filelimits, filepart, 3 );
229 * Format* testFormats[] =
230 * {fileform, NULL, NumberFormat::createInstance(status)};
231 * MessageFormat pattform("There {0} on {1}", status );
232 * pattform.adoptFormats(testFormats, 3);
233 * Formattable testArgs[] = {0L, "Disk A"};
234 * FieldPosition fp(0);
237 * for (int32_t i = 0; i < 4; ++i) {
238 * Formattable fInt(i);
239 * testArgs[0] = fInt;
240 * pattform.format(testArgs, 2, str, fp, status );
241 * str.extract(0, str.length(), buf, "");
243 * cout << "Output for i=" << i << " : " << buf << endl;
250 * <p><em>User subclasses are not supported.</em> While clients may write
251 * subclasses, such code will not necessarily work and will not be
252 * guaranteed to work stably from release to release.
254 class U_I18N_API ChoiceFormat
: public NumberFormat
{
257 * Construct a new ChoiceFormat with the limits and the corresponding formats
258 * based on the pattern.
260 * @param pattern Pattern used to construct object.
261 * @param status Output param to receive success code. If the
262 * pattern cannot be parsed, set to failure code.
265 ChoiceFormat(const UnicodeString
& pattern
,
270 * Construct a new ChoiceFormat with the given limits and formats. Copy
271 * the limits and formats instead of adopting them.
273 * @param limits Array of limit values.
274 * @param formats Array of formats.
275 * @param count Size of 'limits' and 'formats' arrays.
279 ChoiceFormat(const double* limits
,
280 const UnicodeString
* formats
,
284 * Construct a new ChoiceFormat with the given limits and formats.
285 * Copy the limits and formats (instead of adopting them). By
286 * default, each limit in the array specifies the inclusive lower
287 * bound of its range, and the exclusive upper bound of the previous
288 * range. However, if the isLimitOpen element corresponding to a
289 * limit is TRUE, then the limit is the exclusive lower bound of its
290 * range, and the inclusive upper bound of the previous range.
291 * @param limits Array of limit values
292 * @param closures Array of booleans specifying whether each
293 * element of 'limits' is open or closed. If FALSE, then the
294 * corresponding limit is a member of the range above it. If TRUE,
295 * then the limit belongs to the range below it.
296 * @param formats Array of formats
297 * @param count Size of 'limits', 'closures', and 'formats' arrays
300 ChoiceFormat(const double* limits
,
301 const UBool
* closures
,
302 const UnicodeString
* formats
,
308 * @param that ChoiceFormat object to be copied from
311 ChoiceFormat(const ChoiceFormat
& that
);
314 * Assignment operator.
316 * @param that ChoiceFormat object to be copied
319 const ChoiceFormat
& operator=(const ChoiceFormat
& that
);
325 virtual ~ChoiceFormat();
328 * Clone this Format object polymorphically. The caller owns the
329 * result and should delete it when done.
331 * @return a copy of this object
334 virtual Format
* clone(void) const;
337 * Return true if the given Format objects are semantically equal.
338 * Objects of different subclasses are considered unequal.
340 * @param other ChoiceFormat object to be compared
341 * @return true if other is the same as this.
344 virtual UBool
operator==(const Format
& other
) const;
348 * @param pattern The pattern to be applied.
349 * @param status Output param set to success/failure code on
350 * exit. If the pattern is invalid, this will be
351 * set to a failure result.
354 virtual void applyPattern(const UnicodeString
& pattern
,
359 * @param pattern The pattern to be applied.
360 * @param parseError Struct to recieve information on position
361 * of error if an error is encountered
362 * @param status Output param set to success/failure code on
363 * exit. If the pattern is invalid, this will be
364 * set to a failure result.
367 virtual void applyPattern(const UnicodeString
& pattern
,
368 UParseError
& parseError
,
373 * @param pattern Output param which will recieve the pattern
374 * Previous contents are deleted.
375 * @return A reference to 'pattern'
378 virtual UnicodeString
& toPattern(UnicodeString
&pattern
) const;
380 #ifdef U_USE_CHOICE_FORMAT_DEPRECATES
382 * Set the choices to be used in formatting. The arrays are adopted and
383 * should not be deleted by the caller.
385 * @param limitsToAdopt Contains the top value that you want
386 * parsed with that format,and should be in
387 * ascending sorted order. When formatting X,
388 * the choice will be the i, where limit[i]
389 * <= X < limit[i+1].
390 * @param formatsToAdopt The format strings you want to use for each limit.
391 * @param count The size of the above arrays.
392 * @obsolete ICU 2.6. Use setChoices instead since this API will be removed in that release.
394 virtual void adoptChoices(double* limitsToAdopt
,
395 UnicodeString
* formatsToAdopt
,
399 * Set the choices to be used in formatting. The arrays are adopted
400 * and should not be deleted by the caller. See class description
401 * for documenatation of the limits, closures, and formats arrays.
402 * @param limitsToAdopt Array of limits to adopt
403 * @param closuresToAdopt Array of limit booleans to adopt
404 * @param formatsToAdopt Array of format string to adopt
405 * @param count The size of the above arrays
406 * @obsolete ICU 2.6. Use setChoices instead since this API will be removed in that release.
408 virtual void adoptChoices(double* limitsToAdopt
,
409 UBool
* closuresToAdopt
,
410 UnicodeString
* formatsToAdopt
,
415 * Set the choices to be used in formatting.
417 * @param limitsToCopy Contains the top value that you want
418 * parsed with that format,and should be in
419 * ascending sorted order. When formatting X,
420 * the choice will be the i, where limit[i]
421 * <= X < limit[i+1].
422 * @param formatsToCopy The format strings you want to use for each limit.
423 * @param count The size of the above arrays.
426 virtual void setChoices(const double* limitsToCopy
,
427 const UnicodeString
* formatsToCopy
,
431 * Set the choices to be used in formatting. See class description
432 * for documenatation of the limits, closures, and formats arrays.
433 * @param limits Array of limits
434 * @param closures Array of limit booleans
435 * @param formats Array of format string
436 * @param count The size of the above arrays
439 virtual void setChoices(const double* limits
,
440 const UBool
* closures
,
441 const UnicodeString
* formats
,
445 * Get the limits passed in the constructor.
447 * @param count The size of the limits arrays
448 * @return the limits.
451 virtual const double* getLimits(int32_t& count
) const;
454 * Get the limit booleans passed in the constructor. The caller
455 * must not delete the result.
457 * @param count The size of the arrays
458 * @return the closures
461 virtual const UBool
* getClosures(int32_t& count
) const;
464 * Get the formats passed in the constructor.
466 * @param count The size of the arrays
467 * @return the formats.
470 virtual const UnicodeString
* getFormats(int32_t& count
) const;
473 * Format a double or long number using this object's choices.
475 * @param number The value to be formatted.
476 * @param appendTo Output parameter to receive result.
477 * Result is appended to existing contents.
478 * @param pos On input: an alignment field, if desired.
479 * On output: the offsets of the alignment field.
480 * @return Reference to 'appendTo' parameter.
483 virtual UnicodeString
& format(double number
,
484 UnicodeString
& appendTo
,
485 FieldPosition
& pos
) const;
487 * Format a int_32t number using this object's choices.
489 * @param number The value to be formatted.
490 * @param appendTo Output parameter to receive result.
491 * Result is appended to existing contents.
492 * @param pos On input: an alignment field, if desired.
493 * On output: the offsets of the alignment field.
494 * @return Reference to 'appendTo' parameter.
497 virtual UnicodeString
& format(int32_t number
,
498 UnicodeString
& appendTo
,
499 FieldPosition
& pos
) const;
502 * Format an int64_t number using this object's choices.
504 * @param number The value to be formatted.
505 * @param appendTo Output parameter to receive result.
506 * Result is appended to existing contents.
507 * @param pos On input: an alignment field, if desired.
508 * On output: the offsets of the alignment field.
509 * @return Reference to 'appendTo' parameter.
512 virtual UnicodeString
& format(int64_t number
,
513 UnicodeString
& appendTo
,
514 FieldPosition
& pos
) const;
517 * Format an array of objects using this object's choices.
519 * @param objs The array of objects to be formatted.
520 * @param cnt The size of objs.
521 * @param appendTo Output parameter to receive result.
522 * Result is appended to existing contents.
523 * @param pos On input: an alignment field, if desired.
524 * On output: the offsets of the alignment field.
525 * @param success Output param set to success/failure code on
527 * @return Reference to 'appendTo' parameter.
530 virtual UnicodeString
& format(const Formattable
* objs
,
532 UnicodeString
& appendTo
,
534 UErrorCode
& success
) const;
536 * Format an object using this object's choices.
539 * @param obj The object to be formatted.
540 * @param appendTo Output parameter to receive result.
541 * Result is appended to existing contents.
542 * @param pos On input: an alignment field, if desired.
543 * On output: the offsets of the alignment field.
544 * @param status Output param set to success/failure code on
546 * @return Reference to 'appendTo' parameter.
549 virtual UnicodeString
& format(const Formattable
& obj
,
550 UnicodeString
& appendTo
,
552 UErrorCode
& status
) const;
555 * Redeclared NumberFormat method.
557 * @param obj The object to be formatted.
558 * @param appendTo Output parameter to receive result.
559 * Result is appended to existing contents.
560 * @param status Output param set to success/failure code on
562 * @return Reference to 'appendTo' parameter.
565 UnicodeString
& format(const Formattable
& obj
,
566 UnicodeString
& appendTo
,
567 UErrorCode
& status
) const;
570 * Redeclared NumberFormat method.
571 * Format a double number. These methods call the NumberFormat
572 * pure virtual format() methods with the default FieldPosition.
574 * @param number The value to be formatted.
575 * @param appendTo Output parameter to receive result.
576 * Result is appended to existing contents.
577 * @return Reference to 'appendTo' parameter.
580 UnicodeString
& format( double number
,
581 UnicodeString
& appendTo
) const;
584 * Redeclared NumberFormat method.
585 * Format a long number. These methods call the NumberFormat
586 * pure virtual format() methods with the default FieldPosition.
588 * @param number The value to be formatted.
589 * @param appendTo Output parameter to receive result.
590 * Result is appended to existing contents.
591 * @return Reference to 'appendTo' parameter.
594 UnicodeString
& format( int32_t number
,
595 UnicodeString
& appendTo
) const;
598 * Return a long if possible (e.g. within range LONG_MAX,
599 * LONG_MAX], and with no decimals), otherwise a double. If
600 * IntegerOnly is set, will stop at a decimal point (or equivalent;
601 * e.g. for rational numbers "1 2/3", will stop after the 1).
603 * If no object can be parsed, parsePosition is unchanged, and NULL is
606 * @param text The text to be parsed.
607 * @param result Formattable to be set to the parse result.
608 * If parse fails, return contents are undefined.
609 * @param parsePosition The position to start parsing at on input.
610 * On output, moved to after the last successfully
611 * parse character. On parse failure, does not change.
612 * @see NumberFormat::isParseIntegerOnly
615 virtual void parse(const UnicodeString
& text
,
617 ParsePosition
& parsePosition
) const;
620 * Return a long if possible (e.g. within range LONG_MAX,
621 * LONG_MAX], and with no decimals), otherwise a double. If
622 * IntegerOnly is set, will stop at a decimal point (or equivalent;
623 * e.g. for rational numbers "1 2/3", will stop after the 1).
625 * If no object can be parsed, parsePosition is unchanged, and NULL is
628 * @param text The text to be parsed.
629 * @param result Formattable to be set to the parse result.
630 * If parse fails, return contents are undefined.
631 * @param status Output param with the formatted string.
632 * @see NumberFormat::isParseIntegerOnly
635 virtual void parse(const UnicodeString
& text
,
637 UErrorCode
& status
) const;
642 * Returns a unique class ID POLYMORPHICALLY. Pure virtual override.
643 * This method is to implement a simple version of RTTI, since not all
644 * C++ compilers support genuine RTTI. Polymorphic operator==() and
645 * clone() methods call this method.
647 * @return The class ID for this object. All objects of a
648 * given class have the same class ID. Objects of
649 * other classes have different class IDs.
652 virtual UClassID
getDynamicClassID(void) const;
655 * Return the class ID for this class. This is useful only for
656 * comparing to a return value from getDynamicClassID(). For example:
658 * . Base* polymorphic_pointer = createPolymorphicObject();
659 * . if (polymorphic_pointer->getDynamicClassID() ==
660 * . Derived::getStaticClassID()) ...
662 * @return The class ID for all objects of this class.
665 static UClassID U_EXPORT2
getStaticClassID(void);
668 // static cache management (thread-safe)
669 // static NumberFormat* getNumberFormat(UErrorCode &status); // call this function to 'check out' a numberformat from the cache.
670 // static void releaseNumberFormat(NumberFormat *adopt); // call this function to 'return' the number format to the cache.
673 * Converts a string to a double value using a default NumberFormat object
674 * which is static (shared by all ChoiceFormat instances).
675 * @param string the string to be converted with.
676 * @return the converted double number.
678 static double stod(const UnicodeString
& string
);
681 * Converts a double value to a string using a default NumberFormat object
682 * which is static (shared by all ChoiceFormat instances).
683 * @param value the double number to be converted with.
684 * @param string the result string.
685 * @return the converted string.
687 static UnicodeString
& dtos(double value
, UnicodeString
& string
);
689 ChoiceFormat(); // default constructor not implemented
692 * Construct a new ChoiceFormat with the limits and the corresponding formats
693 * based on the pattern.
695 * @param newPattern Pattern used to construct object.
696 * @param parseError Struct to recieve information on position
697 * of error if an error is encountered.
698 * @param status Output param to receive success code. If the
699 * pattern cannot be parsed, set to failure code.
702 ChoiceFormat(const UnicodeString
& newPattern
,
703 UParseError
& parseError
,
706 friend class MessageFormat
;
708 * Each ChoiceFormat divides the range -Inf..+Inf into fCount
709 * intervals. The intervals are:
711 * 0: fChoiceLimits[0]..fChoiceLimits[1]
712 * 1: fChoiceLimits[1]..fChoiceLimits[2]
714 * fCount-2: fChoiceLimits[fCount-2]..fChoiceLimits[fCount-1]
715 * fCount-1: fChoiceLimits[fCount-1]..+Inf
717 * Interval 0 is special; during formatting (mapping numbers to
718 * strings), it also contains all numbers less than
719 * fChoiceLimits[0], as well as NaN values.
721 * Interval i maps to and from string fChoiceFormats[i]. When
722 * parsing (mapping strings to numbers), then intervals map to
723 * their lower limit, that is, interval i maps to fChoiceLimit[i].
725 * The intervals may be closed, half open, or open. This affects
726 * formatting but does not affect parsing. Interval i is affected
727 * by fClosures[i] and fClosures[i+1]. If fClosures[i]
728 * is FALSE, then the value fChoiceLimits[i] is in interval i.
729 * That is, intervals i and i are:
731 * i-1: ... x < fChoiceLimits[i]
732 * i: fChoiceLimits[i] <= x ...
734 * If fClosures[i] is TRUE, then the value fChoiceLimits[i] is
735 * in interval i-1. That is, intervals i-1 and i are:
737 * i-1: ... x <= fChoiceLimits[i]
738 * i: fChoiceLimits[i] < x ...
740 * Because of the nature of interval 0, fClosures[0] has no
744 double* fChoiceLimits
;
746 UnicodeString
* fChoiceFormats
;
750 inline UnicodeString
&
751 ChoiceFormat::format(const Formattable
& obj
,
752 UnicodeString
& appendTo
,
753 UErrorCode
& status
) const {
754 // Don't use Format:: - use immediate base class only,
755 // in case immediate base modifies behavior later.
756 return NumberFormat::format(obj
, appendTo
, status
);
759 inline UnicodeString
&
760 ChoiceFormat::format(double number
,
761 UnicodeString
& appendTo
) const {
762 return NumberFormat::format(number
, appendTo
);
765 inline UnicodeString
&
766 ChoiceFormat::format(int32_t number
,
767 UnicodeString
& appendTo
) const {
768 return NumberFormat::format(number
, appendTo
);
772 #endif /* #if !UCONFIG_NO_FORMATTING */