diff --git a/currency.js b/currency.js index c9fe565a..60bc1981 100644 --- a/currency.js +++ b/currency.js @@ -78,11 +78,24 @@ function satoshiToLocalCurrency(satoshi) { .toString(10); b = parseFloat(b).toFixed(2); - const formatter = new Intl.NumberFormat(preferredFiatCurrency.locale, { - style: 'currency', - currency: preferredFiatCurrency.endPointKey, - minimumFractionDigits: 2, - }); + let formatter; + + try { + formatter = new Intl.NumberFormat(preferredFiatCurrency.locale, { + style: 'currency', + currency: preferredFiatCurrency.endPointKey, + minimumFractionDigits: 2, + }); + } catch (error) { + console.warn(error); + console.log(error); + formatter = new Intl.NumberFormat(FiatUnit.USD.locale, { + style: 'currency', + currency: preferredFiatCurrency.endPointKey, + minimumFractionDigits: 2, + }); + } + return formatter.format(b); } diff --git a/models/fiatUnit.js b/models/fiatUnit.js index 0da32431..3267e6a0 100644 --- a/models/fiatUnit.js +++ b/models/fiatUnit.js @@ -1,5 +1,6 @@ export const FiatUnit = Object.freeze({ USD: { endPointKey: 'USD', symbol: '$', locale: 'en-US' }, + AUD: { endPointKey: 'AUD', symbol: '$', locale: 'en-AU' }, EUR: { endPointKey: 'EUR', symbol: '€', locale: 'en-EN' }, GBP: { endPointKey: 'GBP', symbol: '£', locale: 'en-GB' }, RUB: { endPointKey: 'RUB', symbol: '₽', locale: 'ru-RU' }, @@ -7,4 +8,6 @@ export const FiatUnit = Object.freeze({ CNY: { endPointKey: 'CNY', symbol: '¥', locale: 'zh-CN' }, JPY: { endPointKey: 'JPY', symbol: '¥', locale: 'ja-JP' }, INR: { endPointKey: 'INR', symbol: '₹', locale: 'hi-HN' }, + VEF: { endPointKey: 'VEF', symbol: 'Bs.', locale: 'es-VE' }, + ZAR: { endPointKey: 'ZAR', symbol: 'R', locale: 'en-ZA' }, }); diff --git a/screen/lnd/lndViewInvoice.js b/screen/lnd/lndViewInvoice.js index cd42231c..7345d744 100644 --- a/screen/lnd/lndViewInvoice.js +++ b/screen/lnd/lndViewInvoice.js @@ -166,7 +166,6 @@ export default class LNDViewInvoice extends Component { + + Prices are obtained from CoinDesk + ); }