mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 23:27:26 +01:00
Update index.js
This commit is contained in:
parent
1458fcadda
commit
8e6aaf297e
1 changed files with 2 additions and 7 deletions
|
@ -251,12 +251,7 @@ export function formatBalance(balance, toUnit, withFormatting = false) {
|
|||
const value = new BigNumber(balance).dividedBy(100000000).toFixed(8);
|
||||
return removeTrailingZeros(value) + ' ' + strings.units[BitcoinUnit.BTC];
|
||||
} else if (toUnit === BitcoinUnit.SATS) {
|
||||
return (
|
||||
(balance < 0 ? '-' : '') +
|
||||
(withFormatting ? new Intl.NumberFormat().format(balance.toString()).replace(/[^0-9]/g, ' ') : balance) +
|
||||
' ' +
|
||||
strings.units[BitcoinUnit.SATS]
|
||||
);
|
||||
return (withFormatting ? new Intl.NumberFormat().format(balance.toString()) : balance) + ' ' + strings.units[BitcoinUnit.SATS];
|
||||
} else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) {
|
||||
return currency.satoshiToLocalCurrency(balance);
|
||||
}
|
||||
|
@ -278,7 +273,7 @@ export function formatBalanceWithoutSuffix(balance = 0, toUnit, withFormatting =
|
|||
const value = new BigNumber(balance).dividedBy(100000000).toFixed(8);
|
||||
return removeTrailingZeros(value);
|
||||
} else if (toUnit === BitcoinUnit.SATS) {
|
||||
return (balance < 0 ? '-' : '') + (withFormatting ? new Intl.NumberFormat().format(balance).replace(/[^0-9]/g, ' ') : balance);
|
||||
return withFormatting ? new Intl.NumberFormat().format(balance) : balance;
|
||||
} else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) {
|
||||
return currency.satoshiToLocalCurrency(balance);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue