unumberformatter.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. // © 2018 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. #ifndef __UNUMBERFORMATTER_H__
  4. #define __UNUMBERFORMATTER_H__
  5. #include "unicode/utypes.h"
  6. #if !UCONFIG_NO_FORMATTING
  7. #include "unicode/parseerr.h"
  8. #include "unicode/unumberoptions.h"
  9. #include "unicode/uformattednumber.h"
  10. /**
  11. * \file
  12. * \brief C API: Localized number formatting; not recommended for C++.
  13. *
  14. * This is the C-compatible version of the NumberFormatter API introduced in ICU 60. C++ users should
  15. * include unicode/numberformatter.h and use the proper C++ APIs.
  16. *
  17. * The C API accepts a number skeleton string for specifying the settings for formatting, which covers a
  18. * very large subset of all possible number formatting features. For more information on number skeleton
  19. * strings, see unicode/numberformatter.h.
  20. *
  21. * When using UNumberFormatter, which is treated as immutable, the results are exported to a mutable
  22. * UFormattedNumber object, which you subsequently use for populating your string buffer or iterating over
  23. * the fields.
  24. *
  25. * Example code:
  26. * <pre>
  27. * // Setup:
  28. * UErrorCode ec = U_ZERO_ERROR;
  29. * UNumberFormatter* uformatter = unumf_openForSkeletonAndLocale(u"precision-integer", -1, "en", &ec);
  30. * UFormattedNumber* uresult = unumf_openResult(&ec);
  31. * if (U_FAILURE(ec)) { return; }
  32. *
  33. * // Format a double:
  34. * unumf_formatDouble(uformatter, 5142.3, uresult, &ec);
  35. * if (U_FAILURE(ec)) { return; }
  36. *
  37. * // Export the string to a malloc'd buffer:
  38. * int32_t len = unumf_resultToString(uresult, NULL, 0, &ec);
  39. * // at this point, ec == U_BUFFER_OVERFLOW_ERROR
  40. * ec = U_ZERO_ERROR;
  41. * UChar* buffer = (UChar*) malloc((len+1)*sizeof(UChar));
  42. * unumf_resultToString(uresult, buffer, len+1, &ec);
  43. * if (U_FAILURE(ec)) { return; }
  44. * // buffer should equal "5,142"
  45. *
  46. * // Cleanup:
  47. * unumf_close(uformatter);
  48. * unumf_closeResult(uresult);
  49. * free(buffer);
  50. * </pre>
  51. *
  52. * If you are a C++ user linking against the C libraries, you can use the LocalPointer versions of these
  53. * APIs. The following example uses LocalPointer with the decimal number and field position APIs:
  54. *
  55. * <pre>
  56. * // Setup:
  57. * LocalUNumberFormatterPointer uformatter(unumf_openForSkeletonAndLocale(u"percent", -1, "en", &ec));
  58. * LocalUFormattedNumberPointer uresult(unumf_openResult(&ec));
  59. * if (U_FAILURE(ec)) { return; }
  60. *
  61. * // Format a decimal number:
  62. * unumf_formatDecimal(uformatter.getAlias(), "9.87E-3", -1, uresult.getAlias(), &ec);
  63. * if (U_FAILURE(ec)) { return; }
  64. *
  65. * // Get the location of the percent sign:
  66. * UFieldPosition ufpos = {UNUM_PERCENT_FIELD, 0, 0};
  67. * unumf_resultNextFieldPosition(uresult.getAlias(), &ufpos, &ec);
  68. * // ufpos should contain beginIndex=7 and endIndex=8 since the string is "0.00987%"
  69. *
  70. * // No need to do any cleanup since we are using LocalPointer.
  71. * </pre>
  72. */
  73. /**
  74. * An enum declaring how to resolve conflicts between maximum fraction digits and maximum
  75. * significant digits.
  76. *
  77. * There are two modes, RELAXED and STRICT:
  78. *
  79. * - RELAXED: Relax one of the two constraints (fraction digits or significant digits) in order
  80. * to round the number to a higher level of precision.
  81. * - STRICT: Enforce both constraints, resulting in the number being rounded to a lower
  82. * level of precision.
  83. *
  84. * The default settings for compact notation rounding are Max-Fraction = 0 (round to the nearest
  85. * integer), Max-Significant = 2 (round to 2 significant digits), and priority RELAXED (choose
  86. * the constraint that results in more digits being displayed).
  87. *
  88. * Conflicting *minimum* fraction and significant digits are always resolved in the direction that
  89. * results in more trailing zeros.
  90. *
  91. * Example 1: Consider the number 3.141, with various different settings:
  92. *
  93. * - Max-Fraction = 1: "3.1"
  94. * - Max-Significant = 3: "3.14"
  95. *
  96. * The rounding priority determines how to resolve the conflict when both Max-Fraction and
  97. * Max-Significant are set. With RELAXED, the less-strict setting (the one that causes more digits
  98. * to be displayed) will be used; Max-Significant wins. With STRICT, the more-strict setting (the
  99. * one that causes fewer digits to be displayed) will be used; Max-Fraction wins.
  100. *
  101. * Example 2: Consider the number 8317, with various different settings:
  102. *
  103. * - Max-Fraction = 1: "8317"
  104. * - Max-Significant = 3: "8320"
  105. *
  106. * Here, RELAXED favors Max-Fraction and STRICT favors Max-Significant. Note that this larger
  107. * number caused the two modes to favor the opposite result.
  108. *
  109. * @stable ICU 69
  110. */
  111. typedef enum UNumberRoundingPriority {
  112. /**
  113. * Favor greater precision by relaxing one of the rounding constraints.
  114. *
  115. * @stable ICU 69
  116. */
  117. UNUM_ROUNDING_PRIORITY_RELAXED,
  118. /**
  119. * Favor adherence to all rounding constraints by producing lower precision.
  120. *
  121. * @stable ICU 69
  122. */
  123. UNUM_ROUNDING_PRIORITY_STRICT,
  124. } UNumberRoundingPriority;
  125. /**
  126. * An enum declaring how to render units, including currencies. Example outputs when formatting 123 USD and 123
  127. * meters in <em>en-CA</em>:
  128. *
  129. * <p>
  130. * <ul>
  131. * <li>NARROW*: "$123.00" and "123 m"
  132. * <li>SHORT: "US$ 123.00" and "123 m"
  133. * <li>FULL_NAME: "123.00 US dollars" and "123 meters"
  134. * <li>ISO_CODE: "USD 123.00" and undefined behavior
  135. * <li>HIDDEN: "123.00" and "123"
  136. * </ul>
  137. *
  138. * <p>
  139. * This enum is similar to {@link UMeasureFormatWidth}.
  140. *
  141. * @stable ICU 60
  142. */
  143. typedef enum UNumberUnitWidth {
  144. /**
  145. * Print an abbreviated version of the unit name. Similar to SHORT, but always use the shortest available
  146. * abbreviation or symbol. This option can be used when the context hints at the identity of the unit. For more
  147. * information on the difference between NARROW and SHORT, see SHORT.
  148. *
  149. * <p>
  150. * In CLDR, this option corresponds to the "Narrow" format for measure units and the "¤¤¤¤¤" placeholder for
  151. * currencies.
  152. *
  153. * @stable ICU 60
  154. */
  155. UNUM_UNIT_WIDTH_NARROW = 0,
  156. /**
  157. * Print an abbreviated version of the unit name. Similar to NARROW, but use a slightly wider abbreviation or
  158. * symbol when there may be ambiguity. This is the default behavior.
  159. *
  160. * <p>
  161. * For example, in <em>es-US</em>, the SHORT form for Fahrenheit is "{0} °F", but the NARROW form is "{0}°",
  162. * since Fahrenheit is the customary unit for temperature in that locale.
  163. *
  164. * <p>
  165. * In CLDR, this option corresponds to the "Short" format for measure units and the "¤" placeholder for
  166. * currencies.
  167. *
  168. * @stable ICU 60
  169. */
  170. UNUM_UNIT_WIDTH_SHORT = 1,
  171. /**
  172. * Print the full name of the unit, without any abbreviations.
  173. *
  174. * <p>
  175. * In CLDR, this option corresponds to the default format for measure units and the "¤¤¤" placeholder for
  176. * currencies.
  177. *
  178. * @stable ICU 60
  179. */
  180. UNUM_UNIT_WIDTH_FULL_NAME = 2,
  181. /**
  182. * Use the three-digit ISO XXX code in place of the symbol for displaying currencies. The behavior of this
  183. * option is currently undefined for use with measure units.
  184. *
  185. * <p>
  186. * In CLDR, this option corresponds to the "¤¤" placeholder for currencies.
  187. *
  188. * @stable ICU 60
  189. */
  190. UNUM_UNIT_WIDTH_ISO_CODE = 3,
  191. /**
  192. * Use the formal variant of the currency symbol; for example, "NT$" for the New Taiwan
  193. * dollar in zh-TW.
  194. *
  195. * <p>
  196. * Behavior of this option with non-currency units is not defined at this time.
  197. *
  198. * @stable ICU 68
  199. */
  200. UNUM_UNIT_WIDTH_FORMAL = 4,
  201. /**
  202. * Use the alternate variant of the currency symbol; for example, "TL" for the Turkish
  203. * lira (TRY).
  204. *
  205. * <p>
  206. * Behavior of this option with non-currency units is not defined at this time.
  207. *
  208. * @stable ICU 68
  209. */
  210. UNUM_UNIT_WIDTH_VARIANT = 5,
  211. /**
  212. * Format the number according to the specified unit, but do not display the unit. For currencies, apply
  213. * monetary symbols and formats as with SHORT, but omit the currency symbol. For measure units, the behavior is
  214. * equivalent to not specifying the unit at all.
  215. *
  216. * @stable ICU 60
  217. */
  218. UNUM_UNIT_WIDTH_HIDDEN = 6,
  219. // Do not conditionalize the following with #ifndef U_HIDE_INTERNAL_API,
  220. // needed for unconditionalized struct MacroProps
  221. /**
  222. * One more than the highest UNumberUnitWidth value.
  223. *
  224. * @internal ICU 60: The numeric value may change over time; see ICU ticket #12420.
  225. */
  226. UNUM_UNIT_WIDTH_COUNT = 7
  227. } UNumberUnitWidth;
  228. /**
  229. * An enum declaring how to denote positive and negative numbers. Example outputs when formatting
  230. * 123, 0, and -123 in <em>en-US</em>:
  231. *
  232. * <ul>
  233. * <li>AUTO: "123", "0", and "-123"
  234. * <li>ALWAYS: "+123", "+0", and "-123"
  235. * <li>NEVER: "123", "0", and "123"
  236. * <li>ACCOUNTING: "$123", "$0", and "($123)"
  237. * <li>ACCOUNTING_ALWAYS: "+$123", "+$0", and "($123)"
  238. * <li>EXCEPT_ZERO: "+123", "0", and "-123"
  239. * <li>ACCOUNTING_EXCEPT_ZERO: "+$123", "$0", and "($123)"
  240. * </ul>
  241. *
  242. * <p>
  243. * The exact format, including the position and the code point of the sign, differ by locale.
  244. *
  245. * @stable ICU 60
  246. */
  247. typedef enum UNumberSignDisplay {
  248. /**
  249. * Show the minus sign on negative numbers, and do not show the sign on positive numbers. This is the default
  250. * behavior.
  251. *
  252. * If using this option, a sign will be displayed on negative zero, including negative numbers
  253. * that round to zero. To hide the sign on negative zero, use the NEGATIVE option.
  254. *
  255. * @stable ICU 60
  256. */
  257. UNUM_SIGN_AUTO,
  258. /**
  259. * Show the minus sign on negative numbers and the plus sign on positive numbers, including zero.
  260. * To hide the sign on zero, see {@link UNUM_SIGN_EXCEPT_ZERO}.
  261. *
  262. * @stable ICU 60
  263. */
  264. UNUM_SIGN_ALWAYS,
  265. /**
  266. * Do not show the sign on positive or negative numbers.
  267. *
  268. * @stable ICU 60
  269. */
  270. UNUM_SIGN_NEVER,
  271. /**
  272. * Use the locale-dependent accounting format on negative numbers, and do not show the sign on positive numbers.
  273. *
  274. * <p>
  275. * The accounting format is defined in CLDR and varies by locale; in many Western locales, the format is a pair
  276. * of parentheses around the number.
  277. *
  278. * <p>
  279. * Note: Since CLDR defines the accounting format in the monetary context only, this option falls back to the
  280. * AUTO sign display strategy when formatting without a currency unit. This limitation may be lifted in the
  281. * future.
  282. *
  283. * @stable ICU 60
  284. */
  285. UNUM_SIGN_ACCOUNTING,
  286. /**
  287. * Use the locale-dependent accounting format on negative numbers, and show the plus sign on
  288. * positive numbers, including zero. For more information on the accounting format, see the
  289. * ACCOUNTING sign display strategy. To hide the sign on zero, see
  290. * {@link UNUM_SIGN_ACCOUNTING_EXCEPT_ZERO}.
  291. *
  292. * @stable ICU 60
  293. */
  294. UNUM_SIGN_ACCOUNTING_ALWAYS,
  295. /**
  296. * Show the minus sign on negative numbers and the plus sign on positive numbers. Do not show a
  297. * sign on zero, numbers that round to zero, or NaN.
  298. *
  299. * @stable ICU 61
  300. */
  301. UNUM_SIGN_EXCEPT_ZERO,
  302. /**
  303. * Use the locale-dependent accounting format on negative numbers, and show the plus sign on
  304. * positive numbers. Do not show a sign on zero, numbers that round to zero, or NaN. For more
  305. * information on the accounting format, see the ACCOUNTING sign display strategy.
  306. *
  307. * @stable ICU 61
  308. */
  309. UNUM_SIGN_ACCOUNTING_EXCEPT_ZERO,
  310. /**
  311. * Same as AUTO, but do not show the sign on negative zero.
  312. *
  313. * @stable ICU 69
  314. */
  315. UNUM_SIGN_NEGATIVE,
  316. /**
  317. * Same as ACCOUNTING, but do not show the sign on negative zero.
  318. *
  319. * @stable ICU 69
  320. */
  321. UNUM_SIGN_ACCOUNTING_NEGATIVE,
  322. // Do not conditionalize the following with #ifndef U_HIDE_INTERNAL_API,
  323. // needed for unconditionalized struct MacroProps
  324. /**
  325. * One more than the highest UNumberSignDisplay value.
  326. *
  327. * @internal ICU 60: The numeric value may change over time; see ICU ticket #12420.
  328. */
  329. UNUM_SIGN_COUNT = 9,
  330. } UNumberSignDisplay;
  331. /**
  332. * An enum declaring how to render the decimal separator.
  333. *
  334. * <p>
  335. * <ul>
  336. * <li>UNUM_DECIMAL_SEPARATOR_AUTO: "1", "1.1"
  337. * <li>UNUM_DECIMAL_SEPARATOR_ALWAYS: "1.", "1.1"
  338. * </ul>
  339. *
  340. * @stable ICU 60
  341. */
  342. typedef enum UNumberDecimalSeparatorDisplay {
  343. /**
  344. * Show the decimal separator when there are one or more digits to display after the separator, and do not show
  345. * it otherwise. This is the default behavior.
  346. *
  347. * @stable ICU 60
  348. */
  349. UNUM_DECIMAL_SEPARATOR_AUTO,
  350. /**
  351. * Always show the decimal separator, even if there are no digits to display after the separator.
  352. *
  353. * @stable ICU 60
  354. */
  355. UNUM_DECIMAL_SEPARATOR_ALWAYS,
  356. // Do not conditionalize the following with #ifndef U_HIDE_INTERNAL_API,
  357. // needed for unconditionalized struct MacroProps
  358. /**
  359. * One more than the highest UNumberDecimalSeparatorDisplay value.
  360. *
  361. * @internal ICU 60: The numeric value may change over time; see ICU ticket #12420.
  362. */
  363. UNUM_DECIMAL_SEPARATOR_COUNT
  364. } UNumberDecimalSeparatorDisplay;
  365. /**
  366. * An enum declaring how to render trailing zeros.
  367. *
  368. * - UNUM_TRAILING_ZERO_AUTO: 0.90, 1.00, 1.10
  369. * - UNUM_TRAILING_ZERO_HIDE_IF_WHOLE: 0.90, 1, 1.10
  370. *
  371. * @stable ICU 69
  372. */
  373. typedef enum UNumberTrailingZeroDisplay {
  374. /**
  375. * Display trailing zeros according to the settings for minimum fraction and significant digits.
  376. *
  377. * @stable ICU 69
  378. */
  379. UNUM_TRAILING_ZERO_AUTO,
  380. /**
  381. * Same as AUTO, but hide trailing zeros after the decimal separator if they are all zero.
  382. *
  383. * @stable ICU 69
  384. */
  385. UNUM_TRAILING_ZERO_HIDE_IF_WHOLE,
  386. } UNumberTrailingZeroDisplay;
  387. struct UNumberFormatter;
  388. /**
  389. * C-compatible version of icu::number::LocalizedNumberFormatter.
  390. *
  391. * NOTE: This is a C-compatible API; C++ users should build against numberformatter.h instead.
  392. *
  393. * @stable ICU 62
  394. */
  395. typedef struct UNumberFormatter UNumberFormatter;
  396. /**
  397. * Creates a new UNumberFormatter for the given skeleton string and locale. This is currently the only
  398. * method for creating a new UNumberFormatter.
  399. *
  400. * Objects of type UNumberFormatter returned by this method are threadsafe.
  401. *
  402. * For more details on skeleton strings, see the documentation in numberformatter.h. For more details on
  403. * the usage of this API, see the documentation at the top of unumberformatter.h.
  404. *
  405. * For more information on number skeleton strings, see:
  406. * https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html
  407. *
  408. * NOTE: This is a C-compatible API; C++ users should build against numberformatter.h instead.
  409. *
  410. * @param skeleton The skeleton string, like u"percent precision-integer"
  411. * @param skeletonLen The number of UChars in the skeleton string, or -1 if it is NUL-terminated.
  412. * @param locale The NUL-terminated locale ID.
  413. * @param ec Set if an error occurs.
  414. * @stable ICU 62
  415. */
  416. U_CAPI UNumberFormatter* U_EXPORT2
  417. unumf_openForSkeletonAndLocale(const UChar* skeleton, int32_t skeletonLen, const char* locale,
  418. UErrorCode* ec);
  419. /**
  420. * Like unumf_openForSkeletonAndLocale, but accepts a UParseError, which will be populated with the
  421. * location of a skeleton syntax error if such a syntax error exists.
  422. *
  423. * For more information on number skeleton strings, see:
  424. * https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html
  425. *
  426. * @param skeleton The skeleton string, like u"percent precision-integer"
  427. * @param skeletonLen The number of UChars in the skeleton string, or -1 if it is NUL-terminated.
  428. * @param locale The NUL-terminated locale ID.
  429. * @param perror A parse error struct populated if an error occurs when parsing. Can be NULL.
  430. * If no error occurs, perror->offset will be set to -1.
  431. * @param ec Set if an error occurs.
  432. * @stable ICU 64
  433. */
  434. U_CAPI UNumberFormatter* U_EXPORT2
  435. unumf_openForSkeletonAndLocaleWithError(
  436. const UChar* skeleton, int32_t skeletonLen, const char* locale, UParseError* perror, UErrorCode* ec);
  437. /**
  438. * Uses a UNumberFormatter to format an integer to a UFormattedNumber. A string, field position, and other
  439. * information can be retrieved from the UFormattedNumber.
  440. *
  441. * The UNumberFormatter can be shared between threads. Each thread should have its own local
  442. * UFormattedNumber, however, for storing the result of the formatting operation.
  443. *
  444. * NOTE: This is a C-compatible API; C++ users should build against numberformatter.h instead.
  445. *
  446. * @param uformatter A formatter object created by unumf_openForSkeletonAndLocale or similar.
  447. * @param value The number to be formatted.
  448. * @param uresult The object that will be mutated to store the result; see unumf_openResult.
  449. * @param ec Set if an error occurs.
  450. * @stable ICU 62
  451. */
  452. U_CAPI void U_EXPORT2
  453. unumf_formatInt(const UNumberFormatter* uformatter, int64_t value, UFormattedNumber* uresult,
  454. UErrorCode* ec);
  455. /**
  456. * Uses a UNumberFormatter to format a double to a UFormattedNumber. A string, field position, and other
  457. * information can be retrieved from the UFormattedNumber.
  458. *
  459. * The UNumberFormatter can be shared between threads. Each thread should have its own local
  460. * UFormattedNumber, however, for storing the result of the formatting operation.
  461. *
  462. * NOTE: This is a C-compatible API; C++ users should build against numberformatter.h instead.
  463. *
  464. * @param uformatter A formatter object created by unumf_openForSkeletonAndLocale or similar.
  465. * @param value The number to be formatted.
  466. * @param uresult The object that will be mutated to store the result; see unumf_openResult.
  467. * @param ec Set if an error occurs.
  468. * @stable ICU 62
  469. */
  470. U_CAPI void U_EXPORT2
  471. unumf_formatDouble(const UNumberFormatter* uformatter, double value, UFormattedNumber* uresult,
  472. UErrorCode* ec);
  473. /**
  474. * Uses a UNumberFormatter to format a decimal number to a UFormattedNumber. A string, field position, and
  475. * other information can be retrieved from the UFormattedNumber.
  476. *
  477. * The UNumberFormatter can be shared between threads. Each thread should have its own local
  478. * UFormattedNumber, however, for storing the result of the formatting operation.
  479. *
  480. * The syntax of the unformatted number is a "numeric string" as defined in the Decimal Arithmetic
  481. * Specification, available at http://speleotrove.com/decimal
  482. *
  483. * NOTE: This is a C-compatible API; C++ users should build against numberformatter.h instead.
  484. *
  485. * @param uformatter A formatter object created by unumf_openForSkeletonAndLocale or similar.
  486. * @param value The numeric string to be formatted.
  487. * @param valueLen The length of the numeric string, or -1 if it is NUL-terminated.
  488. * @param uresult The object that will be mutated to store the result; see unumf_openResult.
  489. * @param ec Set if an error occurs.
  490. * @stable ICU 62
  491. */
  492. U_CAPI void U_EXPORT2
  493. unumf_formatDecimal(const UNumberFormatter* uformatter, const char* value, int32_t valueLen,
  494. UFormattedNumber* uresult, UErrorCode* ec);
  495. /**
  496. * Releases the UNumberFormatter created by unumf_openForSkeletonAndLocale().
  497. *
  498. * @param uformatter An object created by unumf_openForSkeletonAndLocale().
  499. * @stable ICU 62
  500. */
  501. U_CAPI void U_EXPORT2
  502. unumf_close(UNumberFormatter* uformatter);
  503. #if U_SHOW_CPLUSPLUS_API
  504. U_NAMESPACE_BEGIN
  505. /**
  506. * \class LocalUNumberFormatterPointer
  507. * "Smart pointer" class; closes a UNumberFormatter via unumf_close().
  508. * For most methods see the LocalPointerBase base class.
  509. *
  510. * Usage:
  511. * <pre>
  512. * LocalUNumberFormatterPointer uformatter(unumf_openForSkeletonAndLocale(...));
  513. * // no need to explicitly call unumf_close()
  514. * </pre>
  515. *
  516. * @see LocalPointerBase
  517. * @see LocalPointer
  518. * @stable ICU 62
  519. */
  520. U_DEFINE_LOCAL_OPEN_POINTER(LocalUNumberFormatterPointer, UNumberFormatter, unumf_close);
  521. U_NAMESPACE_END
  522. #endif // U_SHOW_CPLUSPLUS_API
  523. #endif /* #if !UCONFIG_NO_FORMATTING */
  524. #endif //__UNUMBERFORMATTER_H__