Fixed float value to 4 decimals.

This commit is contained in:
Gustavo Cortez 2014-04-17 11:51:56 -03:00
parent dd62ab16d1
commit c9008830b0
2 changed files with 6 additions and 1 deletions

View File

@ -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;
};

View File

@ -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);
});
};