From f8286bf3f9a18dd166e8e1977d9f2d150e4bd8b3 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Wed, 20 Nov 2024 00:07:54 -0400 Subject: [PATCH] Update currency.ts --- blue_modules/currency.ts | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/blue_modules/currency.ts b/blue_modules/currency.ts index 30f0c5384..f8eb918ff 100644 --- a/blue_modules/currency.ts +++ b/blue_modules/currency.ts @@ -48,19 +48,6 @@ function getCurrencyFormatter(): Intl.NumberFormat { return currencyFormatter; } -function getBTCFormatter(): Intl.NumberFormat { - if (!btcFormatter || btcFormatter.resolvedOptions().locale !== preferredFiatCurrency.locale) { - btcFormatter = new Intl.NumberFormat(preferredFiatCurrency.locale, { - minimumFractionDigits: 8, - maximumFractionDigits: 8, - }); - console.debug('Created new BTC formatter'); - } else { - console.debug('Using cached BTC formatter'); - } - return btcFormatter; -} - async function setPreferredCurrency(item: FiatUnitType): Promise { await DefaultPreference.setName(GROUP_IO_BLUEWALLET); await DefaultPreference.set(PREFERRED_CURRENCY_STORAGE_KEY, JSON.stringify(item)); @@ -377,12 +364,7 @@ function getCurrencySymbol(): string { } function formatBTC(btc: BigNumber.Value): string { - try { - return getBTCFormatter().format(Number(btc)); - } catch (error) { - console.error(error); - return new BigNumber(btc).toFixed(8); - } + return new BigNumber(btc).toFormat(8); } function _setPreferredFiatCurrency(currency: FiatUnitType): void {