fix truncateSatoshis for x === 0
This commit is contained in:
parent
e230edc3f7
commit
a7fb79016f
1 changed files with 1 additions and 0 deletions
|
|
@ -177,6 +177,7 @@ function billsAndTxs(client, session, cb) {
|
||||||
// lamassu-machine and lamassu-server and need to stay in sync.
|
// lamassu-machine and lamassu-server and need to stay in sync.
|
||||||
function bitcoinFractionalDigits(amount) {
|
function bitcoinFractionalDigits(amount) {
|
||||||
var log = Math.floor(Math.log(amount) / Math.log(10));
|
var log = Math.floor(Math.log(amount) / Math.log(10));
|
||||||
|
if (log < -8) log = -8;
|
||||||
return (log > 0) ? 2 : 2 - log;
|
return (log > 0) ? 2 : 2 - log;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue