+void DecimalFormat::setCurrencyUsage(UCurrencyUsage newContext, UErrorCode* ec){
+ fCurrencyUsage = newContext;
+
+ const UChar* theCurrency = getCurrency();
+
+ // We set rounding/digit based on currency context
+ if(theCurrency){
+ double rounding = ucurr_getRoundingIncrementForUsage(theCurrency, fCurrencyUsage, ec);
+ int32_t frac = ucurr_getDefaultFractionDigitsForUsage(theCurrency, fCurrencyUsage, ec);
+
+ if (U_SUCCESS(*ec)) {
+ setRoundingIncrement(rounding);
+ setMinimumFractionDigits(frac);
+ setMaximumFractionDigits(frac);
+ }
+ }
+}
+
+UCurrencyUsage DecimalFormat::getCurrencyUsage() const {
+ return fCurrencyUsage;
+}
+