home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / include / unum.h < prev    next >
C/C++ Source or Header  |  1999-11-12  |  21KB  |  563 lines

  1. /*
  2. *******************************************************************************
  3. *                                                                             *
  4. * COPYRIGHT:                                                                  *
  5. *   (C) Copyright Taligent, Inc.,  1996                                       *
  6. *   (C) Copyright International Business Machines Corporation,  1998-1999     *
  7. *   Licensed Material - Program-Property of IBM - All Rights Reserved.        *
  8. *   US Government Users Restricted Rights - Use, duplication, or disclosure   *
  9. *   restricted by GSA ADP Schedule Contract with IBM Corp.                    *
  10. *                                                                             *
  11. * Modification History:
  12. *
  13. *   Date        Name        Description
  14. *   06/24/99    helena      Integrated Alan's NF enhancements and Java2 bug fixes
  15. *******************************************************************************
  16. */
  17.  
  18. #ifndef _UNUM
  19. #define _UNUM
  20.  
  21. #include "utypes.h"
  22. #include "umisc.h"
  23.  
  24. /**
  25.  * Number Format C API  Provides functions for
  26.  * formatting and parsing a number.  Also provides methods for
  27.  * determining which locales have number formats, and what their names
  28.  * are.
  29.  * <P>
  30.  * UNumberFormat helps you to format and parse numbers for any locale.
  31.  * Your code can be completely independent of the locale conventions
  32.  * for decimal points, thousands-separators, or even the particular
  33.  * decimal digits used, or whether the number format is even decimal.
  34.  * There are different number format styles like decimal, currency,
  35.  * percent and spellout. 
  36.  * <P>
  37.  * To format a number for the current Locale, use one of the static
  38.  * factory methods:
  39.  * <pre>
  40.  * .   UChar myString[20];
  41.  * .   UFieldPosition pos=0;
  42.  * .   double myNumber = 7.0;
  43.  * .   UErrorCode success = U_ZERO_ERROR;
  44.  * .   UNumberFormat* nf = unum_open(UNUM_DEFAULT, NULL, &success)
  45.  * .   unum_formatDouble(nf, myNumber, myString, u_strlen(myString), &pos, &status);
  46.  * .   printf(" Example 1: %s\n", austrdup(myString) ); //austrdup( a function used to convert UChar* to char*)
  47.  * </pre>
  48.  * If you are formatting multiple numbers, it is more efficient to get
  49.  * the format and use it multiple times so that the system doesn't
  50.  * have to fetch the information about the local language and country
  51.  * conventions multiple times.
  52.  * <pre>
  53.  * .    UChar* myString;
  54.  * .    t_int32 i, resultlength, reslenneeded;
  55.  * .    UErrorCode success = U_ZERO_ERROR;
  56.  * .    UFieldPosition pos=0;
  57.  * .    t_int32 a[] = { 123, 3333, -1234567 };
  58.  * .    const t_int32 a_len = sizeof(a) / sizeof(a[0]);
  59.  * .    UNumberFormat* nf = unum_open(UNUM_DEFAULT, NULL, &success)
  60.  * .    for (i = 0; i < a_len; i++) {
  61.  * .    resultlength=0;
  62.  * .    reslenneeded=unum_format(nf, a[i], NULL, resultlength, &pos, &status);
  63.  * .    if(status==U_BUFFER_OVERFLOW_ERROR){
  64.  * .        status=U_ZERO_ERROR;
  65.  * .        resultlength=resultlengthneeded+1;
  66.  * .        result=(UChar*)malloc(sizeof(UChar) * resultlength);
  67.  * .        unum_format(nf, a[i], result, resultlength, &pos, &status);
  68.  * .    }
  69.  * .    printf(" Example 2: %s\n", austrdup(result) );
  70.  * .    free(result);
  71.  * .    }
  72.  * </pre>
  73.  * To format a number for a different Locale, specify it in the
  74.  * call to unum_open().
  75.  * <pre>
  76.  * .    UNumberFormat* nf = unum_open(UNUM_DEFAULT, "fr_FR", &success)
  77.  * </pre>
  78.  * You can use a NumberFormat API unum_parse() to parse.
  79.  * <pre>
  80.  * .   UErrorCode success;
  81.  * .   t_int32 pos=0;
  82.  * .   unum_parse(nf, result, u_strlen(result), &pos, &success);
  83.  * </pre>
  84.  * Use UCAL_DECIMAL to get the normal number format for that country.
  85.  * There are other static options available.  Use UCAL_CURRENCY
  86.  * to get the currency number format for that country.  Use UCAL_PERCENT
  87.  * to get a format for displaying percentages. With this format, a
  88.  * fraction from 0.53 is displayed as 53%.
  89.  * <P>
  90.  * You can also control the display of numbers with such function as
  91.  * unum_getAttribues() and unum_setAtributes().  where in you can set the
  92.  * miminum fraction digits, grouping used etc.
  93.  * @see UNumberFormatAttributes for more details
  94.  * <P>
  95.  * You can also use forms of the parse and format methods with
  96.  * ParsePosition and UFieldPosition to allow you to:
  97.  * <ul type=round>
  98.  *   <li>(a) progressively parse through pieces of a string.
  99.  *   <li>(b) align the decimal point and other areas.
  100.  * </ul>
  101.  * <p>
  102.  * It is also possible to change or set the symbols used for a particular
  103.  * locale like the currency symbol, the grouping seperator , monetary seperator 
  104.  * etc by making use of functions unum_setSymbols() and unum_getSymbols().
  105.  */
  106. /** A number formatter */
  107. typedef void* UNumberFormat;
  108.  
  109. /** The possible number format styles. */
  110. enum UNumberFormatStyle {
  111.     /** Decimal format */
  112.     UNUM_DECIMAL,
  113.     /** Currency format */
  114.     UNUM_CURRENCY,
  115.     /** Percent format */
  116.     UNUM_PERCENT,
  117.     /** Spellout format */
  118.     UNUM_SPELLOUT,
  119.     /** Default format */
  120.     UNUM_DEFAULT = UNUM_DECIMAL
  121. };
  122. typedef enum UNumberFormatStyle UNumberFormatStyle;
  123.  
  124. enum UNumberFormatRoundingMode {
  125.     UNUM_ROUND_CEILING,
  126.     UNUM_ROUND_FLOOR,
  127.     UNUM_ROUND_DOWN,
  128.     UNUM_ROUND_UP,
  129.     UNUM_FOUND_HALFEVEN,
  130.     UNUM_ROUND_HALFDOWN,
  131.     UNUM_ROUND_HALFUP
  132. };
  133. typedef enum UNumberFormatRoundingMode UNumberFormatRoundingMode;
  134.  
  135. enum UNumberFormatPadPosition {
  136.     UNUM_PAD_BEFORE_PREFIX,
  137.     UNUM_PAD_AFTER_PREFIX,
  138.     UNUM_PAD_BEFORE_SUFFIX,
  139.     UNUM_PAD_AFTER_SUFFIX
  140. };
  141. typedef enum UNumberFormatPadPosition UNumberFormatPadPosition;
  142.  
  143. /**
  144. * Open a new UNumberFormat for formatting and parsing numbers.
  145. * A UNumberFormat may be used to format numbers in calls to \Ref{unum_format},
  146. * and to parse numbers in calls to \Ref{unum_parse}.
  147. * @param style The type of number format to open: one of UNUM_DECIMAL, UNUM_CURRENCY,
  148. * UNUM_PERCENT, UNUM_SPELLOUT, or UNUM_DEFAULT
  149. * @param locale The locale specifying the formatting conventions
  150. * @param status A pointer to an UErrorCode to receive any errors
  151. * @return A pointer to a UNumberFormat to use for formatting numbers, or 0 if
  152. * an error occurred.
  153. * @see unum_openPattern
  154. */
  155. U_CAPI UNumberFormat*
  156. unum_open(UNumberFormatStyle    style,
  157.       const   char*        locale,
  158.       UErrorCode*        status);
  159.  
  160. /**
  161. * Open a new UNumberFormat for formatting and parsing numbers.
  162. * A UNumberFormat may be used to format numbers in calls to \Ref{unum_format},
  163. * and to parse numbers in calls to \Ref{unum_parse}.
  164. * @param pattern A pattern specifying the format to use.
  165. * @param patternLength The number of characters in the pattern, or -1 if null-terminated.
  166. * @param locale The locale specifying the formatting conventions
  167. * @param status A pointer to an UErrorCode to receive any errors
  168. * @return A pointer to a UNumberFormat to use for formatting numbers, or 0 if
  169. * an error occurred.
  170. * @see unum_open
  171. */
  172. U_CAPI UNumberFormat*
  173. unum_openPattern(    const    UChar*        pattern,
  174.             int32_t            patternLength,
  175.             const    char*        locale,
  176.             UErrorCode*        status);
  177.  
  178. /**
  179. * Close a UNumberFormat.
  180. * Once closed, a UNumberFormat may no longer be used.
  181. * @param fmt The formatter to close.
  182. */
  183. U_CAPI void
  184. unum_close(UNumberFormat* fmt);
  185.  
  186. /**
  187.  * Open a copy of a UNumberFormat.
  188.  * This function performs a deep copy.
  189.  * @param fmt The format to copy
  190.  * @param status A pointer to an UErrorCode to receive any errors.
  191.  * @return A pointer to a UNumberFormat identical to fmt.
  192.  */
  193. U_CAPI UNumberFormat*
  194. unum_clone(const UNumberFormat *fmt,
  195.        UErrorCode *status);
  196.  
  197. /**
  198. * Format an integer using a UNumberFormat.
  199. * The integer will be formatted according to the UNumberFormat's locale.
  200. * @param fmt The formatter to use.
  201. * @param number The number to format.
  202. * @param result A pointer to a buffer to receive the formatted number.
  203. * @param resultLength The maximum size of result.
  204. * @param pos If not 0, a UFieldPosition which will receive the information on a specific field.
  205. * @param status A pointer to an UErrorCode to receive any errors
  206. * @return The total buffer size needed; if greater than resultLength, the output was truncated.
  207. * @see unum_formatDouble
  208. * @see unum_parse
  209. * @see unum_parseDouble
  210. */
  211. U_CAPI int32_t
  212. unum_format(    const    UNumberFormat*    fmt,
  213.         int32_t            number,
  214.         UChar*            result,
  215.         int32_t            resultLength,
  216.         UFieldPosition    *pos,
  217.         UErrorCode*        status);
  218.  
  219. /**
  220. * Format a double using a UNumberFormat.
  221. * The double will be formatted according to the UNumberFormat's locale.
  222. * @param fmt The formatter to use.
  223. * @param number The number to format.
  224. * @param result A pointer to a buffer to receive the formatted number.
  225. * @param resultLength The maximum size of result.
  226. * @param pos If not 0, a UFieldPosition which will receive the information on a specific field.
  227. * @param status A pointer to an UErrorCode to receive any errors
  228. * @return The total buffer size needed; if greater than resultLength, the output was truncated.
  229. * @see unum_format
  230. * @see unum_parse
  231. * @see unum_parseDouble
  232. */
  233. U_CAPI int32_t
  234. unum_formatDouble(    const    UNumberFormat*  fmt,
  235.             double          number,
  236.             UChar*          result,
  237.             int32_t         resultLength,
  238.             UFieldPosition  *pos, /* 0 if ignore */
  239.             UErrorCode*     status);
  240.  
  241. /**
  242. * Parse a string into an integer using a UNumberFormat.
  243. * The string will be parsed according to the UNumberFormat's locale.
  244. * @param fmt The formatter to use.
  245. * @param text The text to parse.
  246. * @param textLength The length of text, or -1 if null-terminated.
  247. * @param parsePos If not 0, on input a pointer to an integer specifying the offset at which
  248. * to begin parsing.  If not 0, on output the offset at which parsing ended.
  249. * @param status A pointer to an UErrorCode to receive any errors
  250. * @return The value of the parsed integer
  251. * @see unum_parseDouble
  252. * @see unum_format
  253. * @see unum_formatDouble
  254. */
  255. U_CAPI int32_t
  256. unum_parse(    const   UNumberFormat*  fmt,
  257.         const   UChar*          text,
  258.         int32_t         textLength,
  259.         int32_t         *parsePos /* 0 = start */,
  260.         UErrorCode      *status);
  261.  
  262. /**
  263. * Parse a string into a double using a UNumberFormat.
  264. * The string will be parsed according to the UNumberFormat's locale.
  265. * @param fmt The formatter to use.
  266. * @param text The text to parse.
  267. * @param textLength The length of text, or -1 if null-terminated.
  268. * @param parsePos If not 0, on input a pointer to an integer specifying the offset at which
  269. * to begin parsing.  If not 0, on output the offset at which parsing ended.
  270. * @param status A pointer to an UErrorCode to receive any errors
  271. * @return The value of the parsed double
  272. * @see unum_parse
  273. * @see unum_format
  274. * @see unum_formatDouble
  275. */
  276. U_CAPI double
  277. unum_parseDouble(    const   UNumberFormat*  fmt,
  278.             const   UChar*          text,
  279.             int32_t         textLength,
  280.             int32_t         *parsePos /* 0 = start */,
  281.             UErrorCode      *status);
  282.  
  283. /**
  284. * Get a locale for which number formatting patterns are available.
  285. * A UNumberFormat in a locale returned by this function will perform the correct
  286. * formatting and parsing for the locale.
  287. * @param index The index of the desired locale.
  288. * @return A locale for which number formatting patterns are available, or 0 if none.
  289. * @see unum_countAvailable
  290. */
  291. U_CAPI const char*
  292. unum_getAvailable(int32_t index);
  293.  
  294. /**
  295. * Determine how many locales have number formatting patterns available.
  296. * This function is most useful as determining the loop ending condition for
  297. * calls to \Ref{unum_getAvailable}.
  298. * @return The number of locales for which number formatting patterns are available.
  299. * @see unum_getAvailable
  300. */
  301. U_CAPI int32_t
  302. unum_countAvailable(void);
  303.  
  304. /** The possible UNumberFormat numeric attributes */
  305. enum UNumberFormatAttribute { 
  306.   /** Parse integers only */
  307.   UNUM_PARSE_INT_ONLY,
  308.   /** Use grouping separator */
  309.   UNUM_GROUPING_USED,
  310.   /** Always show decimal point */
  311.   UNUM_DECIMAL_ALWAYS_SHOWN,
  312.   /** Maximum integer digits */
  313.   UNUM_MAX_INTEGER_DIGITS,
  314.   /** Minimum integer digits */
  315.   UNUM_MIN_INTEGER_DIGITS,
  316.   /** Integer digits */
  317.   UNUM_INTEGER_DIGITS,
  318.   /** Maximum fraction digits */
  319.   UNUM_MAX_FRACTION_DIGITS,
  320.   /** Minimum fraction digits */
  321.   UNUM_MIN_FRACTION_DIGITS,
  322.   /** Fraction digits */
  323.   UNUM_FRACTION_DIGITS,
  324.   /** Multiplier */
  325.   UNUM_MULTIPLIER,
  326.   /** Grouping size */
  327.   UNUM_GROUPING_SIZE,
  328.   /** Rounding Mode */
  329.   UNUM_ROUNDING_MODE,
  330.   /** Rounding increment */
  331.   UNUM_ROUNDING_INCREMENT,
  332.   /** The width to which the output of <code>format()</code> is padded. */
  333.   UNUM_FORMAT_WIDTH,
  334.   /** The position at which padding will take place. */
  335.   UNUM_PADDING_POSITION
  336. };
  337. typedef enum UNumberFormatAttribute UNumberFormatAttribute;
  338.  
  339. /*====================================================
  340. ======================================================
  341.     ---> Add to UErrorCode !!!! --->
  342. typedef enum {
  343.     AttributeNotSupported, 
  344.     PropertyNotSupported  
  345. } UErrorCode;
  346.     ---> Add to UErrorCode !!!! --->
  347. ======================================================
  348. ====================================================*/
  349.  
  350. /**
  351. * Get a numeric attribute associated with a UNumberFormat.
  352. * An example of a numeric attribute is the number of integer digits a formatter will produce.
  353. * @param fmt The formatter to query.
  354. * @param attr The attribute to query; one of UNUM_PARSE_INT_ONLY, UNUM_GROUPING_USED, 
  355. * UNUM_DECIMAL_ALWAYS_SHOWN, UNUM_MAX_INTEGER_DIGITS, UNUM_MIN_INTEGER_DIGITS, UNUM_INTEGER_DIGITS,
  356. * UNUM_MAX_FRACTION_DIGITS, UNUM_MIN_FRACTION_DIGITS, UNUM_FRACTION_DIGITS, UNUM_MULTIPLIER, 
  357. * UNUM_GROUPING_SIZE, UNUM_ROUNDING_MODE, UNUM_FORMAT_WIDTH, UNUM_PADDING_POSITION.
  358. * @return The value of attr.
  359. * @see unum_setAttribute
  360. * @see unum_getDoubleAttribute
  361. * @see unum_setDoubleAttribute
  362. * @see unum_getTextAttribute
  363. * @see unum_setTextAttribute
  364. */
  365. U_CAPI int32_t
  366. unum_getAttribute(const UNumberFormat*          fmt,
  367.           UNumberFormatAttribute  attr);
  368.  
  369. /**
  370. * Set a numeric attribute associated with a UNumberFormat.
  371. * An example of a numeric attribute is the number of integer digits a formatter will produce.
  372. * @param fmt The formatter to set.
  373. * @param attr The attribute to set; one of UNUM_PARSE_INT_ONLY, UNUM_GROUPING_USED, 
  374. * UNUM_DECIMAL_ALWAYS_SHOWN, UNUM_MAX_INTEGER_DIGITS, UNUM_MIN_INTEGER_DIGITS, UNUM_INTEGER_DIGITS,
  375. * UNUM_MAX_FRACTION_DIGITS, UNUM_MIN_FRACTION_DIGITS, UNUM_FRACTION_DIGITS, UNUM_MULTIPLIER, 
  376. * UNUM_GROUPING_SIZE, UNUM_ROUNDING_MODE, UNUM_FORMAT_WIDTH, UNUM_PADDING_POSITION.
  377. * @param newValue The new value of attr.
  378. * @see unum_getAttribute
  379. * @see unum_getDoubleAttribute
  380. * @see unum_setDoubleAttribute
  381. * @see unum_getTextAttribute
  382. * @see unum_setTextAttribute
  383. */
  384. U_CAPI void
  385. unum_setAttribute(    UNumberFormat*          fmt,
  386.             UNumberFormatAttribute  attr,
  387.             int32_t                 newValue);
  388.  
  389.  
  390. /**
  391. * Get a numeric attribute associated with a UNumberFormat.
  392. * An example of a numeric attribute is the number of integer digits a formatter will produce.
  393. * @param fmt The formatter to query.
  394. * @param attr The attribute to query; e.g. UNUM_ROUNDING_INCREMENT.
  395. * @return The value of attr.
  396. * @see unum_getAttribute
  397. * @see unum_setAttribute
  398. * @see unum_setDoubleAttribute
  399. * @see unum_getTextAttribute
  400. * @see unum_setTextAttribute
  401. */
  402. U_CAPI double
  403. unum_getDoubleAttribute(const UNumberFormat*          fmt,
  404.           UNumberFormatAttribute  attr);
  405.  
  406. /**
  407. * Set a numeric attribute associated with a UNumberFormat.
  408. * An example of a numeric attribute is the number of integer digits a formatter will produce.
  409. * @param fmt The formatter to set.
  410. * @param attr The attribute to set; e.g. UNUM_ROUNDING_INCREMENT.
  411. * @param newValue The new value of attr.
  412. * @see unum_getAttribute
  413. * @see unum_setAttribute
  414. * @see unum_getDoubleAttribute
  415. * @see unum_getTextAttribute
  416. * @see unum_setTextAttribute
  417. */
  418. U_CAPI void
  419. unum_setDoubleAttribute(    UNumberFormat*          fmt,
  420.             UNumberFormatAttribute  attr,
  421.             double                 newValue);
  422.  
  423. /** The possible UNumberFormat text attributes */
  424. enum UNumberFormatTextAttribute{
  425.   /** Positive prefix */
  426.   UNUM_POSITIVE_PREFIX,
  427.   /** Positive suffix */
  428.   UNUM_POSITIVE_SUFFIX,
  429.   /** Negative prefix */
  430.   UNUM_NEGATIVE_PREFIX,
  431.   /** Negative suffix */
  432.   UNUM_NEGATIVE_SUFFIX,
  433.   /** The character used to pad to the format width. */
  434.   UNUM_PADDING_CHARACTER
  435. };
  436. typedef enum UNumberFormatTextAttribute UNumberFormatTextAttribute;
  437.  
  438. /**
  439. * Get a text attribute associated with a UNumberFormat.
  440. * An example of a text attribute is the suffix for positive numbers.
  441. * @param fmt The formatter to query.
  442. * @param attr The attribute to query; one of UNUM_POSITIVE_PREFIX, UNUM_POSITIVE_SUFFIX, 
  443. * UNUM_NEGATIVE_PREFIX, UNUM_NEGATIVE_SUFFIX
  444. * @param result A pointer to a buffer to receive the attribute.
  445. * @param resultLength The maximum size of result.
  446. * @param status A pointer to an UErrorCode to receive any errors
  447. * @return The total buffer size needed; if greater than resultLength, the output was truncated.
  448. * @see unum_setTextAttribute
  449. * @see unum_getAttribute
  450. * @see unum_setAttribute
  451. */
  452. U_CAPI int32_t
  453. unum_getTextAttribute(    const    UNumberFormat*                    fmt,
  454.             UNumberFormatTextAttribute      tag,
  455.             UChar*                            result,
  456.             int32_t                            resultLength,
  457.             UErrorCode*                        status);
  458.  
  459. /**
  460. * Set a text attribute associated with a UNumberFormat.
  461. * An example of a text attribute is the suffix for positive numbers.
  462. * @param fmt The formatter to set.
  463. * @param attr The attribute to set; one of UNUM_POSITIVE_PREFIX, UNUM_POSITIVE_SUFFIX, 
  464. * UNUM_NEGATIVE_PREFIX, UNUM_NEGATIVE_SUFFIX
  465. * @param newValue The new value of attr.
  466. * @param newValueLength The length of newValue, or -1 if null-terminated.
  467. * @param status A pointer to an UErrorCode to receive any errors
  468. * @see unum_getTextAttribute
  469. * @see unum_getAttribute
  470. * @see unum_setAttribute
  471. */
  472. U_CAPI void
  473. unum_setTextAttribute(    UNumberFormat*                    fmt,
  474.             UNumberFormatTextAttribute      tag,
  475.             const    UChar*                            newValue,
  476.             int32_t                            newValueLength,
  477.             UErrorCode                        *status);
  478.  
  479. /**
  480. * Extract the pattern from a UNumberFormat.
  481. * The pattern will follow the pattern syntax.
  482. * @param fmt The formatter to query.
  483. * @param isPatternLocalized TRUE if the pattern should be localized, FALSE otherwise.
  484. * @param result A pointer to a buffer to receive the pattern.
  485. * @param resultLength The maximum size of result.
  486. * @param status A pointer to an UErrorCode to receive any errors
  487. * @return The total buffer size needed; if greater than resultLength, the output was truncated.
  488. */
  489. U_CAPI int32_t
  490. unum_toPattern(    const    UNumberFormat*          fmt,
  491.         bool_t                  isPatternLocalized,
  492.         UChar*                  result,
  493.         int32_t                 resultLength,
  494.         UErrorCode*             status);
  495.  
  496. /** The maximum size for a textual number format symbol */
  497. #define UNFSYMBOLSMAXSIZE 10
  498.  
  499. /** The UNumberFormatSymbols struct */
  500. struct UNumberFormatSymbols{
  501.   /** The decimal separator */
  502.   UChar decimalSeparator;
  503.   /** The grouping separator */
  504.   UChar groupingSeparator;
  505.   /** The pattern separator */
  506.   UChar patternSeparator;
  507.   /** The percent sign */
  508.   UChar percent;
  509.   /** Zero*/
  510.   UChar zeroDigit;
  511.   /** Character representing a digit in the pattern */
  512.   UChar digit;
  513.   /** The minus sign */
  514.   UChar minusSign;
  515.   /** The plus sign */
  516.   UChar plusSign;
  517.   /** The currency symbol */
  518.   UChar currency      [UNFSYMBOLSMAXSIZE];
  519.   /** The international currency symbol */
  520.   UChar intlCurrency  [UNFSYMBOLSMAXSIZE];
  521.   /** The monetary separator */
  522.   UChar monetarySeparator;
  523.   /** The exponential symbol */
  524.   UChar exponential;  
  525.   /** Per mill symbol */
  526.   UChar perMill;
  527.   /** Escape padding character */
  528.   UChar padEscape;
  529.   /** Infinity symbol */
  530.   UChar infinity      [UNFSYMBOLSMAXSIZE];
  531.   /** Nan symbol */
  532.   UChar naN           [UNFSYMBOLSMAXSIZE];  
  533. };
  534. typedef struct UNumberFormatSymbols UNumberFormatSymbols;
  535.  
  536. /**
  537. * Get the symbols associated with a UNumberFormat.
  538. * A UNumberFormat uses symbols to represent the special locale-dependent 
  539. * characters in a number, for example the percent sign.
  540. * @param fmt The formatter to query.
  541. * @param syms A pointer to a UNumberFormatSymbols to receive the symbols associated with fmt.
  542. * @see unum_setSymbols
  543. */
  544. U_CAPI void
  545. unum_getSymbols(    const    UNumberFormat            *fmt,
  546.             UNumberFormatSymbols    *syms);
  547.  
  548. /**
  549. * Set the symbols associated with a UNumberFormat.
  550. * A UNumberFormat uses symbols to represent the special locale-dependent 
  551. * characters in a number, for example the percent sign.
  552. * @param fmt The formatter to set.
  553. * @param symbolsToSet The UNumberFormatSymbols to associate with fmt.
  554. * @param status A pointer to an UErrorCode to receive any errors.
  555. * @see unum_getSymbols
  556. */
  557. U_CAPI void
  558. unum_setSymbols(    UNumberFormat*          fmt,
  559.             const   UNumberFormatSymbols*   symbolsToSet,
  560.             UErrorCode                *status);
  561.  
  562. #endif
  563.