mirror of https://github.com/BTCPrivate/copay.git
Fixed float value to 4 decimals.
This commit is contained in:
parent
dd62ab16d1
commit
c9008830b0
|
@ -34,7 +34,9 @@ Insight.prototype.getBalance = function(unspent) {
|
||||||
for(var i=0;i<unspent.length; i++) {
|
for(var i=0;i<unspent.length; i++) {
|
||||||
balance = balance + unspent[i].amount;
|
balance = balance + unspent[i].amount;
|
||||||
}
|
}
|
||||||
|
if (balance) {
|
||||||
|
balance = balance.toFixed(4);
|
||||||
|
}
|
||||||
return balance;
|
return balance;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -282,6 +282,9 @@ Wallet.prototype.getBalance = function(cb) {
|
||||||
for(var i=0;i<unspent.length; i++) {
|
for(var i=0;i<unspent.length; i++) {
|
||||||
balance = balance + unspent[i].amount;
|
balance = balance + unspent[i].amount;
|
||||||
}
|
}
|
||||||
|
if (balance) {
|
||||||
|
balance = balance.toFixed(4);
|
||||||
|
}
|
||||||
return cb(balance);
|
return cb(balance);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue