Index: source/i18n/unum.cpp |
diff --git a/source/i18n/unum.cpp b/source/i18n/unum.cpp |
index 9703f5d6a99b450bf91af658157e834812344d17..802caaddd8910a2b8b7312159f9da243a0080068 100644 |
--- a/source/i18n/unum.cpp |
+++ b/source/i18n/unum.cpp |
@@ -1,6 +1,6 @@ |
/* |
******************************************************************************* |
-* Copyright (C) 1996-2013, International Business Machines |
+* Copyright (C) 1996-2014, International Business Machines |
* Corporation and others. All Rights Reserved. |
******************************************************************************* |
* Modification History: |
@@ -25,6 +25,7 @@ |
#include "unicode/dcfmtsym.h" |
#include "unicode/curramt.h" |
#include "unicode/localpointer.h" |
+#include "unicode/udisplaycontext.h" |
#include "uassert.h" |
#include "cpputils.h" |
#include "cstring.h" |
@@ -51,6 +52,10 @@ unum_open( UNumberFormatStyle style, |
case UNUM_CURRENCY: |
case UNUM_PERCENT: |
case UNUM_SCIENTIFIC: |
+ case UNUM_CURRENCY_ISO: |
+ case UNUM_CURRENCY_PLURAL: |
+ case UNUM_CURRENCY_ACCOUNTING: |
+ case UNUM_CASH_CURRENCY: |
retVal = NumberFormat::createInstance(Locale(locale), style, *status); |
break; |
@@ -783,6 +788,25 @@ unum_getLocaleByType(const UNumberFormat *fmt, |
return ((const Format*)fmt)->getLocaleID(type, *status); |
} |
+U_CAPI void U_EXPORT2 |
+unum_setContext(UNumberFormat* fmt, UDisplayContext value, UErrorCode* status) |
+{ |
+ if (U_FAILURE(*status)) { |
+ return; |
+ } |
+ ((NumberFormat*)fmt)->setContext(value, *status); |
+ return; |
+} |
+ |
+U_CAPI UDisplayContext U_EXPORT2 |
+unum_getContext(const UNumberFormat *fmt, UDisplayContextType type, UErrorCode* status) |
+{ |
+ if (U_FAILURE(*status)) { |
+ return (UDisplayContext)0; |
+ } |
+ return ((const NumberFormat*)fmt)->getContext(type, *status); |
+} |
+ |
U_INTERNAL UFormattable * U_EXPORT2 |
unum_parseToUFormattable(const UNumberFormat* fmt, |
UFormattable *result, |