diff --git a/src/nativescript-intl.android.ts b/src/nativescript-intl.android.ts index 73f7942..7ee8ee5 100644 --- a/src/nativescript-intl.android.ts +++ b/src/nativescript-intl.android.ts @@ -160,6 +160,11 @@ export class NumberFormat extends commonNumberFormat { let decimalFormatSymbols = locale ? new java.text.DecimalFormatSymbols(getNativeLocale(locale)) : new java.text.DecimalFormatSymbols(); + + if (options && options.currency !== void 0) { + decimalFormatSymbols.setCurrency(java.util.Currency.getInstance(options.currency)); + } + numberFormat.setDecimalFormatSymbols(decimalFormatSymbols); if (options && (options.style.toLowerCase() === "currency" && options.currencyDisplay === "code")) { @@ -170,10 +175,6 @@ export class NumberFormat extends commonNumberFormat { numberFormat = new java.text.DecimalFormat(currrentPattern); numberFormat.setDecimalFormatSymbols(decimalFormatSymbols); } - - if (options.currency !== void 0) { - decimalFormatSymbols.setCurrency(java.util.Currency.getInstance(options.currency)); - } } return numberFormat.format(value);