Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

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(). More...


Enumerations

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


Functions

const UChar * ucurr_forLocale (const char *locale, UErrorCode *ec)
 Returns a currency code for the default currency in the given locale. More...

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

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

const UChar * 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. More...

int32_t ucurr_getDefaultFractionDigits (const UChar *currency)
 Returns the number of the number of fraction digits that should be displayed for the given currency. More...

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


Typedef Documentation

typedef enum UCurrNameStyle UCurrNameStyle
 

Selector constants for ucurr_getName().

See also:
ucurr_getName
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

typedef const void* UCurrRegistryKey
 

Definition at line 17 of file ucurr.h.


Enumeration Type Documentation

enum UCurrNameStyle
 

Selector constants for ucurr_getName().

See also:
ucurr_getName
Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.
Enumeration values:
UCURR_SYMBOL_NAME  Selector for ucurr_getName indicating a symbolic name for a currency, such as "$" for USD.

Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.
UCURR_LONG_NAME  Selector for ucurr_getName indicating the long name for a currency, such as "US Dollar" for USD.

Draft:
This API has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

Definition at line 55 of file ucurr.h.


Function Documentation

const UChar* ucurr_forLocale const char *    locale,
UErrorCode   ec
 

Returns a currency code for the default currency in the given locale.

Parameters:
locale  the locale for which to retrieve a currency code
ec  error code
Returns:
a pointer to a 3-character ISO 4217 currency code, or NULL if none is found.
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

int32_t ucurr_getDefaultFractionDigits const UChar *    currency
 

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
Returns:
a non-negative number of fraction digits to be displayed
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

const UChar* 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 has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

double ucurr_getRoundingIncrement const UChar *    currency
 

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
Returns:
the non-negative rounding increment, or 0.0 if none
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

UCurrRegistryKey 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 has been introduced in ICU 2.6. It is still in draft state and may be modified in a future release.

UBool 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


Generated on Thu Jun 12 13:09:58 2003 for ICU 2.6 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001