ucurr.h File Reference

#include "unicode/utypes.h"

Go to the source code of this file.

Typedefs

typedef const void * UCurrRegistryKey
typedef enum UCurrNameStyle UCurrNameStyle
 Selector constants for ucurr_getName().


Enumerations

enum  UCurrNameStyle { UCURR_SYMBOL_NAME, UCURR_LONG_NAME }
 Selector constants for ucurr_getName(). More...


Functions

U_DRAFT int32_t U_EXPORT2 ucurr_forLocale (const char *locale, UChar *buff, int32_t buffCapacity, UErrorCode *ec)
 Finds a currency code for the given locale.

U_DRAFT UCurrRegistryKey U_EXPORT2 ucurr_register (const UChar *isoCode, const char *locale, UErrorCode *status)
 Register an (existing) ISO 4217 currency code for the given locale.

U_DRAFT UBool U_EXPORT2 ucurr_unregister (UCurrRegistryKey key, UErrorCode *status)
 Unregister the previously-registered currency definitions using the URegistryKey returned from ucurr_register.

U_DRAFT const UChar *U_EXPORT2 ucurr_getName (const UChar *currency, const char *locale, UCurrNameStyle nameStyle, UBool *isChoiceFormat, int32_t *len, UErrorCode *ec)
 Returns the display name for the given currency in the given locale.

U_DRAFT int32_t U_EXPORT2 ucurr_getDefaultFractionDigits (const UChar *currency, UErrorCode *ec)
 Returns the number of the number of fraction digits that should be displayed for the given currency.

U_DRAFT double U_EXPORT2 ucurr_getRoundingIncrement (const UChar *currency, UErrorCode *ec)
 Returns the rounding increment for the given currency, or 0.0 if no rounding is done by the currency.


Typedef Documentation

typedef enum UCurrNameStyle UCurrNameStyle
 

Selector constants for ucurr_getName().

See also:
ucurr_getName
Draft:
This API may be changed in the future versions and was introduced in ICU 2.6

typedef const void* UCurrRegistryKey
 

Internal:
Do not use. This API is for interal use only.

Definition at line 19 of file ucurr.h.


Enumeration Type Documentation

enum UCurrNameStyle
 

Selector constants for ucurr_getName().

See also:
ucurr_getName
Draft:
This API may be changed in the future versions and was introduced in ICU 2.6
Enumeration values:
UCURR_SYMBOL_NAME  Selector for ucurr_getName indicating a symbolic name for a currency, such as "$" for USD.

Draft:
This API may be changed in the future versions and was introduced in ICU 2.6
UCURR_LONG_NAME  Selector for ucurr_getName indicating the long name for a currency, such as "US Dollar" for USD.

Draft:
This API may be changed in the future versions and was introduced in ICU 2.6

Definition at line 69 of file ucurr.h.


Function Documentation

U_DRAFT int32_t U_EXPORT2 ucurr_forLocale const char *  locale,
UChar buff,
int32_t  buffCapacity,
UErrorCode ec
 

Finds a currency code for the given locale.

Parameters:
locale the locale for which to retrieve a currency code. Currency can be specified by the "currency" keyword in which case it overrides the default currency code
buff fill in buffer. Can be NULL for preflighting.
buffCapacity capacity of the fill in buffer. Can be 0 for preflighting. If it is non-zero, the buff parameter must not be NULL.
ec error code
Returns:
length of the currency string. It should always be 3. If 0, currency couldn't be found or the input values are invalid.
Draft:
This API may be changed in the future versions and was introduced in ICU 2.8

U_DRAFT int32_t U_EXPORT2 ucurr_getDefaultFractionDigits const UChar currency,
UErrorCode ec
 

Returns the number of the number of fraction digits that should be displayed for the given currency.

Parameters:
currency null-terminated 3-letter ISO 4217 code
ec input-output error code
Returns:
a non-negative number of fraction digits to be displayed, or 0 if there is an error
Draft:
This API may be changed in the future versions and was introduced in ICU 3.0

U_DRAFT const UChar* U_EXPORT2 ucurr_getName const UChar currency,
const char *  locale,
UCurrNameStyle  nameStyle,
UBool isChoiceFormat,
int32_t len,
UErrorCode ec
 

Returns the display name for the given currency in the given locale.

For example, the display name for the USD currency object in the en_US locale is "$".

Parameters:
currency null-terminated 3-letter ISO 4217 code
locale locale in which to display currency
nameStyle selector for which kind of name to return
isChoiceFormat fill-in set to TRUE if the returned value is a ChoiceFormat pattern; otherwise it is a static string
len fill-in parameter to receive length of result
ec error code
Returns:
pointer to display string of 'len' UChars. If the resource data contains no entry for 'currency', then 'currency' itself is returned. If *isChoiceFormat is TRUE, then the result is a ChoiceFormat pattern. Otherwise it is a static string.
Draft:
This API may be changed in the future versions and was introduced in ICU 2.6

U_DRAFT double U_EXPORT2 ucurr_getRoundingIncrement const UChar currency,
UErrorCode ec
 

Returns the rounding increment for the given currency, or 0.0 if no rounding is done by the currency.

Parameters:
currency null-terminated 3-letter ISO 4217 code
ec input-output error code
Returns:
the non-negative rounding increment, or 0.0 if none, or 0.0 if there is an error
Draft:
This API may be changed in the future versions and was introduced in ICU 3.0

U_DRAFT UCurrRegistryKey U_EXPORT2 ucurr_register const UChar isoCode,
const char *  locale,
UErrorCode status
 

Register an (existing) ISO 4217 currency code for the given locale.

Only the country code and the two variants EURO and PRE_EURO are recognized.

Parameters:
isoCode the three-letter ISO 4217 currency code
locale the locale for which to register this currency code
status the in/out status code
Returns:
a registry key that can be used to unregister this currency code, or NULL if there was an error.
Draft:
This API may be changed in the future versions and was introduced in ICU 2.6

U_DRAFT UBool U_EXPORT2 ucurr_unregister UCurrRegistryKey  key,
UErrorCode status
 

Unregister the previously-registered currency definitions using the URegistryKey returned from ucurr_register.

Key becomes invalid after a successful call and should not be used again. Any currency that might have been hidden by the original ucurr_register call is restored.

Parameters:
key the registry key returned by a previous call to ucurr_register
status the in/out status code, no special meanings are assigned
Returns:
TRUE if the currency for this key was successfully unregistered
Draft:
This API may be changed in the future versions and was introduced in ICU 2.6


Generated on Fri Jun 18 12:36:10 2004 for ICU by doxygen 1.3.7