mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
FIX: ints representation via BigNumber
This commit is contained in:
parent
eefb095a2c
commit
44bffa7936
@ -97,8 +97,11 @@ export class LegacyWallet extends AbstractWallet {
|
||||
throw new Error('Could not fetch UTXO from API' + response.err);
|
||||
}
|
||||
|
||||
this.balance = json.final_balance / 100000000;
|
||||
this.unconfirmed_balance = json.unconfirmed_balance / 100000000;
|
||||
this.balance = new BigNumber(json.final_balance);
|
||||
this.balance = this.balance.div(100000000).toString() * 1;
|
||||
this.unconfirmed_balance = new BigNumber(json.unconfirmed_balance);
|
||||
this.unconfirmed_balance =
|
||||
this.unconfirmed_balance.div(100000000).toString() * 1;
|
||||
this._lastBalanceFetch = +new Date();
|
||||
} catch (err) {
|
||||
console.warn(err);
|
||||
|
@ -2,6 +2,7 @@ import LocalizedStrings from 'react-localization';
|
||||
import { AsyncStorage } from 'react-native';
|
||||
import { Util } from 'expo';
|
||||
import { AppStorage } from '../class';
|
||||
let BigNumber = require('bignumber.js');
|
||||
let strings;
|
||||
|
||||
// first-time loading sequence
|
||||
@ -65,7 +66,8 @@ strings.transactionTimeToReadable = function(time) {
|
||||
|
||||
strings.formatBalance = function(balance) {
|
||||
if (balance < 0.1 && balance !== 0) {
|
||||
return balance * 1000 + ' mBTC';
|
||||
let b = new BigNumber(balance);
|
||||
return b.mul(1000).toString() + ' mBTC';
|
||||
}
|
||||
return balance + ' BTC';
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user