From a7fb79016fbdedacead671f281570d89669eb15b Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Thu, 4 Dec 2014 18:13:14 -0500 Subject: [PATCH] fix truncateSatoshis for x === 0 --- lib/postgresql_interface.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/postgresql_interface.js b/lib/postgresql_interface.js index d21fad3f..b128d9b5 100644 --- a/lib/postgresql_interface.js +++ b/lib/postgresql_interface.js @@ -177,6 +177,7 @@ function billsAndTxs(client, session, cb) { // lamassu-machine and lamassu-server and need to stay in sync. function bitcoinFractionalDigits(amount) { var log = Math.floor(Math.log(amount) / Math.log(10)); + if (log < -8) log = -8; return (log > 0) ? 2 : 2 - log; }