OLD | NEW |
1 /* | 1 /* |
2 ********************************************************************** | 2 ********************************************************************** |
3 * Copyright (c) 2002-2014, International Business Machines | 3 * Copyright (c) 2002-2015, International Business Machines |
4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
5 ********************************************************************** | 5 ********************************************************************** |
6 */ | 6 */ |
7 #ifndef _UCURR_H_ | 7 #ifndef _UCURR_H_ |
8 #define _UCURR_H_ | 8 #define _UCURR_H_ |
9 | 9 |
10 #include "unicode/utypes.h" | 10 #include "unicode/utypes.h" |
11 #include "unicode/uenum.h" | 11 #include "unicode/uenum.h" |
12 | 12 |
13 /** | 13 /** |
14 * \file | 14 * \file |
15 * \brief C API: Encapsulates information about a currency. | 15 * \brief C API: Encapsulates information about a currency. |
16 */ | 16 */ |
17 | 17 |
18 #if !UCONFIG_NO_FORMATTING | 18 #if !UCONFIG_NO_FORMATTING |
19 | 19 |
20 /** | 20 /** |
21 * Currency Usage used for Decimal Format | 21 * Currency Usage used for Decimal Format |
22 * @draft ICU 54 | 22 * @stable ICU 54 |
23 */ | 23 */ |
24 enum UCurrencyUsage { | 24 enum UCurrencyUsage { |
25 #ifndef U_HIDE_DRAFT_API | |
26 /** | 25 /** |
27 * a setting to specify currency usage which determines currency digit | 26 * a setting to specify currency usage which determines currency digit |
28 * and rounding for standard usage, for example: "50.00 NT$" | 27 * and rounding for standard usage, for example: "50.00 NT$" |
29 * used as DEFAULT value | 28 * used as DEFAULT value |
30 * @draft ICU 54 | 29 * @stable ICU 54 |
31 */ | 30 */ |
32 UCURR_USAGE_STANDARD=0, | 31 UCURR_USAGE_STANDARD=0, |
33 /** | 32 /** |
34 * a setting to specify currency usage which determines currency digit | 33 * a setting to specify currency usage which determines currency digit |
35 * and rounding for cash usage, for example: "50 NT$" | 34 * and rounding for cash usage, for example: "50 NT$" |
36 * @draft ICU 54 | 35 * @stable ICU 54 |
37 */ | 36 */ |
38 UCURR_USAGE_CASH=1, | 37 UCURR_USAGE_CASH=1, |
39 #endif /* U_HIDE_DRAFT_API */ | |
40 /** | 38 /** |
41 * One higher than the last enum UCurrencyUsage constant. | 39 * One higher than the last enum UCurrencyUsage constant. |
42 * @draft ICU 54 | 40 * @stable ICU 54 |
43 */ | 41 */ |
44 UCURR_USAGE_COUNT=2 | 42 UCURR_USAGE_COUNT=2 |
45 }; | 43 }; |
46 typedef enum UCurrencyUsage UCurrencyUsage; | 44 typedef enum UCurrencyUsage UCurrencyUsage; |
47 | 45 |
48 /** | 46 /** |
49 * The ucurr API encapsulates information about a currency, as defined by | 47 * The ucurr API encapsulates information about a currency, as defined by |
50 * ISO 4217. A currency is represented by a 3-character string | 48 * ISO 4217. A currency is represented by a 3-character string |
51 * containing its ISO 4217 code. This API can return various data | 49 * containing its ISO 4217 code. This API can return various data |
52 * necessary the proper display of a currency: | 50 * necessary the proper display of a currency: |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 * @param currency null-terminated 3-letter ISO 4217 code | 195 * @param currency null-terminated 3-letter ISO 4217 code |
198 * @param ec input-output error code | 196 * @param ec input-output error code |
199 * @return a non-negative number of fraction digits to be | 197 * @return a non-negative number of fraction digits to be |
200 * displayed, or 0 if there is an error | 198 * displayed, or 0 if there is an error |
201 * @stable ICU 3.0 | 199 * @stable ICU 3.0 |
202 */ | 200 */ |
203 U_STABLE int32_t U_EXPORT2 | 201 U_STABLE int32_t U_EXPORT2 |
204 ucurr_getDefaultFractionDigits(const UChar* currency, | 202 ucurr_getDefaultFractionDigits(const UChar* currency, |
205 UErrorCode* ec); | 203 UErrorCode* ec); |
206 | 204 |
207 #ifndef U_HIDE_DRAFT_API | |
208 /** | 205 /** |
209 * Returns the number of the number of fraction digits that should | 206 * Returns the number of the number of fraction digits that should |
210 * be displayed for the given currency with usage. | 207 * be displayed for the given currency with usage. |
211 * @param currency null-terminated 3-letter ISO 4217 code | 208 * @param currency null-terminated 3-letter ISO 4217 code |
212 * @param usage enum usage for the currency | 209 * @param usage enum usage for the currency |
213 * @param ec input-output error code | 210 * @param ec input-output error code |
214 * @return a non-negative number of fraction digits to be | 211 * @return a non-negative number of fraction digits to be |
215 * displayed, or 0 if there is an error | 212 * displayed, or 0 if there is an error |
216 * @draft ICU 54 | 213 * @stable ICU 54 |
217 */ | 214 */ |
218 U_DRAFT int32_t U_EXPORT2 | 215 U_STABLE int32_t U_EXPORT2 |
219 ucurr_getDefaultFractionDigitsForUsage(const UChar* currency, | 216 ucurr_getDefaultFractionDigitsForUsage(const UChar* currency, |
220 const UCurrencyUsage usage, | 217 const UCurrencyUsage usage, |
221 UErrorCode* ec); | 218 UErrorCode* ec); |
222 #endif /* U_HIDE_DRAFT_API */ | |
223 | 219 |
224 /** | 220 /** |
225 * Returns the rounding increment for the given currency, or 0.0 if no | 221 * Returns the rounding increment for the given currency, or 0.0 if no |
226 * rounding is done by the currency. | 222 * rounding is done by the currency. |
227 * This is equivalent to ucurr_getRoundingIncrementForUsage(currency,UCURR_USAGE
_STANDARD,ec); | 223 * This is equivalent to ucurr_getRoundingIncrementForUsage(currency,UCURR_USAGE
_STANDARD,ec); |
228 * @param currency null-terminated 3-letter ISO 4217 code | 224 * @param currency null-terminated 3-letter ISO 4217 code |
229 * @param ec input-output error code | 225 * @param ec input-output error code |
230 * @return the non-negative rounding increment, or 0.0 if none, | 226 * @return the non-negative rounding increment, or 0.0 if none, |
231 * or 0.0 if there is an error | 227 * or 0.0 if there is an error |
232 * @stable ICU 3.0 | 228 * @stable ICU 3.0 |
233 */ | 229 */ |
234 U_STABLE double U_EXPORT2 | 230 U_STABLE double U_EXPORT2 |
235 ucurr_getRoundingIncrement(const UChar* currency, | 231 ucurr_getRoundingIncrement(const UChar* currency, |
236 UErrorCode* ec); | 232 UErrorCode* ec); |
237 | 233 |
238 #ifndef U_HIDE_DRAFT_API | |
239 /** | 234 /** |
240 * Returns the rounding increment for the given currency, or 0.0 if no | 235 * Returns the rounding increment for the given currency, or 0.0 if no |
241 * rounding is done by the currency given usage. | 236 * rounding is done by the currency given usage. |
242 * @param currency null-terminated 3-letter ISO 4217 code | 237 * @param currency null-terminated 3-letter ISO 4217 code |
243 * @param usage enum usage for the currency | 238 * @param usage enum usage for the currency |
244 * @param ec input-output error code | 239 * @param ec input-output error code |
245 * @return the non-negative rounding increment, or 0.0 if none, | 240 * @return the non-negative rounding increment, or 0.0 if none, |
246 * or 0.0 if there is an error | 241 * or 0.0 if there is an error |
247 * @draft ICU 54 | 242 * @stable ICU 54 |
248 */ | 243 */ |
249 U_DRAFT double U_EXPORT2 | 244 U_STABLE double U_EXPORT2 |
250 ucurr_getRoundingIncrementForUsage(const UChar* currency, | 245 ucurr_getRoundingIncrementForUsage(const UChar* currency, |
251 const UCurrencyUsage usage, | 246 const UCurrencyUsage usage, |
252 UErrorCode* ec); | 247 UErrorCode* ec); |
253 #endif /* U_HIDE_DRAFT_API */ | |
254 | 248 |
255 /** | 249 /** |
256 * Selector constants for ucurr_openCurrencies(). | 250 * Selector constants for ucurr_openCurrencies(). |
257 * | 251 * |
258 * @see ucurr_openCurrencies | 252 * @see ucurr_openCurrencies |
259 * @stable ICU 3.2 | 253 * @stable ICU 3.2 |
260 */ | 254 */ |
261 typedef enum UCurrCurrencyType { | 255 typedef enum UCurrCurrencyType { |
262 /** | 256 /** |
263 * Select all ISO-4217 currency codes. | 257 * Select all ISO-4217 currency codes. |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 * @param currency null-terminated 3-letter ISO 4217 code | 409 * @param currency null-terminated 3-letter ISO 4217 code |
416 * @return The ISO 4217 numeric code of the currency | 410 * @return The ISO 4217 numeric code of the currency |
417 * @stable ICU 49 | 411 * @stable ICU 49 |
418 */ | 412 */ |
419 U_STABLE int32_t U_EXPORT2 | 413 U_STABLE int32_t U_EXPORT2 |
420 ucurr_getNumericCode(const UChar* currency); | 414 ucurr_getNumericCode(const UChar* currency); |
421 | 415 |
422 #endif /* #if !UCONFIG_NO_FORMATTING */ | 416 #endif /* #if !UCONFIG_NO_FORMATTING */ |
423 | 417 |
424 #endif | 418 #endif |
OLD | NEW |