Fixed float value to 4 decimals.
This commit is contained in:
parent
dd62ab16d1
commit
c9008830b0
2 changed files with 6 additions and 1 deletions
|
|
@ -34,7 +34,9 @@ Insight.prototype.getBalance = function(unspent) {
|
|||
for(var i=0;i<unspent.length; i++) {
|
||||
balance = balance + unspent[i].amount;
|
||||
}
|
||||
|
||||
if (balance) {
|
||||
balance = balance.toFixed(4);
|
||||
}
|
||||
return balance;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -282,6 +282,9 @@ Wallet.prototype.getBalance = function(cb) {
|
|||
for(var i=0;i<unspent.length; i++) {
|
||||
balance = balance + unspent[i].amount;
|
||||
}
|
||||
if (balance) {
|
||||
balance = balance.toFixed(4);
|
||||
}
|
||||
return cb(balance);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue