| Index: source/i18n/unicode/ucurr.h
|
| diff --git a/source/i18n/unicode/ucurr.h b/source/i18n/unicode/ucurr.h
|
| index 27698133e4210613b43f9891624e0ba36e5827d1..5b196901693f40cc259f963efa99809348a63946 100644
|
| --- a/source/i18n/unicode/ucurr.h
|
| +++ b/source/i18n/unicode/ucurr.h
|
| @@ -1,6 +1,6 @@
|
| /*
|
| **********************************************************************
|
| -* Copyright (c) 2002-2013, International Business Machines
|
| +* Copyright (c) 2002-2014, International Business Machines
|
| * Corporation and others. All Rights Reserved.
|
| **********************************************************************
|
| */
|
| @@ -18,6 +18,34 @@
|
| #if !UCONFIG_NO_FORMATTING
|
|
|
| /**
|
| + * Currency Usage used for Decimal Format
|
| + * @draft ICU 54
|
| + */
|
| +enum UCurrencyUsage {
|
| +#ifndef U_HIDE_DRAFT_API
|
| + /**
|
| + * a setting to specify currency usage which determines currency digit
|
| + * and rounding for standard usage, for example: "50.00 NT$"
|
| + * used as DEFAULT value
|
| + * @draft ICU 54
|
| + */
|
| + UCURR_USAGE_STANDARD=0,
|
| + /**
|
| + * a setting to specify currency usage which determines currency digit
|
| + * and rounding for cash usage, for example: "50 NT$"
|
| + * @draft ICU 54
|
| + */
|
| + UCURR_USAGE_CASH=1,
|
| +#endif /* U_HIDE_DRAFT_API */
|
| + /**
|
| + * One higher than the last enum UCurrencyUsage constant.
|
| + * @draft ICU 54
|
| + */
|
| + UCURR_USAGE_COUNT=2
|
| +};
|
| +typedef enum UCurrencyUsage UCurrencyUsage;
|
| +
|
| +/**
|
| * The ucurr API encapsulates information about a currency, as defined by
|
| * ISO 4217. A currency is represented by a 3-character string
|
| * containing its ISO 4217 code. This API can return various data
|
| @@ -165,6 +193,7 @@ ucurr_getPluralName(const UChar* currency,
|
| /**
|
| * Returns the number of the number of fraction digits that should
|
| * be displayed for the given currency.
|
| + * This is equivalent to ucurr_getDefaultFractionDigitsForUsage(currency,UCURR_USAGE_STANDARD,ec);
|
| * @param currency null-terminated 3-letter ISO 4217 code
|
| * @param ec input-output error code
|
| * @return a non-negative number of fraction digits to be
|
| @@ -175,9 +204,27 @@ U_STABLE int32_t U_EXPORT2
|
| ucurr_getDefaultFractionDigits(const UChar* currency,
|
| UErrorCode* ec);
|
|
|
| +#ifndef U_HIDE_DRAFT_API
|
| +/**
|
| + * Returns the number of the number of fraction digits that should
|
| + * be displayed for the given currency with usage.
|
| + * @param currency null-terminated 3-letter ISO 4217 code
|
| + * @param usage enum usage for the currency
|
| + * @param ec input-output error code
|
| + * @return a non-negative number of fraction digits to be
|
| + * displayed, or 0 if there is an error
|
| + * @draft ICU 54
|
| + */
|
| +U_DRAFT int32_t U_EXPORT2
|
| +ucurr_getDefaultFractionDigitsForUsage(const UChar* currency,
|
| + const UCurrencyUsage usage,
|
| + UErrorCode* ec);
|
| +#endif /* U_HIDE_DRAFT_API */
|
| +
|
| /**
|
| * Returns the rounding increment for the given currency, or 0.0 if no
|
| * rounding is done by the currency.
|
| + * This is equivalent to ucurr_getRoundingIncrementForUsage(currency,UCURR_USAGE_STANDARD,ec);
|
| * @param currency null-terminated 3-letter ISO 4217 code
|
| * @param ec input-output error code
|
| * @return the non-negative rounding increment, or 0.0 if none,
|
| @@ -188,6 +235,23 @@ U_STABLE double U_EXPORT2
|
| ucurr_getRoundingIncrement(const UChar* currency,
|
| UErrorCode* ec);
|
|
|
| +#ifndef U_HIDE_DRAFT_API
|
| +/**
|
| + * Returns the rounding increment for the given currency, or 0.0 if no
|
| + * rounding is done by the currency given usage.
|
| + * @param currency null-terminated 3-letter ISO 4217 code
|
| + * @param usage enum usage for the currency
|
| + * @param ec input-output error code
|
| + * @return the non-negative rounding increment, or 0.0 if none,
|
| + * or 0.0 if there is an error
|
| + * @draft ICU 54
|
| + */
|
| +U_DRAFT double U_EXPORT2
|
| +ucurr_getRoundingIncrementForUsage(const UChar* currency,
|
| + const UCurrencyUsage usage,
|
| + UErrorCode* ec);
|
| +#endif /* U_HIDE_DRAFT_API */
|
| +
|
| /**
|
| * Selector constants for ucurr_openCurrencies().
|
| *
|
|
|