mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
FIX: correct satoshi display
This commit is contained in:
parent
e0a469ad03
commit
e18396b124
2
index.js
2
index.js
@ -1,3 +1,5 @@
|
||||
import 'intl';
|
||||
import 'intl/locale-data/jsonp/en';
|
||||
import React from 'react';
|
||||
import './shim.js';
|
||||
import App from './App';
|
||||
|
@ -106,15 +106,11 @@ strings.formatBalanceWithoutSuffix = (balance, toUnit) => {
|
||||
return balance;
|
||||
}
|
||||
if (balance !== 0) {
|
||||
if (toUnit === BitcoinUnit.BTC || toUnit === undefined) {
|
||||
if (toUnit === BitcoinUnit.BTC) {
|
||||
const value = new BigNumber(balance).dividedBy(100000000).toFixed(8);
|
||||
return removeTrailingZeros(value);
|
||||
} else if (toUnit === BitcoinUnit.SATS) {
|
||||
const value = new BigNumber(balance)
|
||||
.multipliedBy(0.0001)
|
||||
.toString()
|
||||
.replace('.', '');
|
||||
return parseFloat(value).toLocaleString();
|
||||
return balance;
|
||||
} else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) {
|
||||
return currency.satoshiToLocalCurrency(balance);
|
||||
}
|
||||
|
5
package-lock.json
generated
5
package-lock.json
generated
@ -5791,6 +5791,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"intl": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/intl/-/intl-1.2.5.tgz",
|
||||
"integrity": "sha1-giRKIZDE5Bn4Nx9ao02qNCDiq94="
|
||||
},
|
||||
"invariant": {
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
|
||||
|
@ -52,6 +52,7 @@
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"events": "^1.1.1",
|
||||
"frisbee": "^1.6.4",
|
||||
"intl": "^1.2.5",
|
||||
"isaac": "0.0.5",
|
||||
"mocha": "^5.2.0",
|
||||
"node-libs-react-native": "^1.0.1",
|
||||
|
Loading…
Reference in New Issue
Block a user