aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2015-11-24 11:39:40 -0800
committerAdam Soltys <[email protected]>2015-11-27 22:02:48 -0800
commited284b9ca93f03b9dc8fce3744baab59588d43f1 (patch)
tree33b6555c5df41615ab8b25cd05871b9a517cd78e
parent64298f7a55bc7a97e04658a10ed85e45b51520db (diff)
downloadcoinos-server-ed284b9ca93f03b9dc8fce3744baab59588d43f1.tar.gz
coinos-server-ed284b9ca93f03b9dc8fce3744baab59588d43f1.zip
Fix tolerance calculation
-rw-r--r--public/js/wallet.coffee4
1 files changed, 3 insertions, 1 deletions
diff --git a/public/js/wallet.coffee b/public/js/wallet.coffee
index d9ef9b29..b7a71d7e 100644
--- a/public/js/wallet.coffee
+++ b/public/js/wallet.coffee
@@ -39,7 +39,9 @@ $(->
$('#amount').attr('step', 0.01)
else
amount = parseFloat($('#amount').val() * multiplier() / g.exchange).toFixed(precision())
- if Math.abs(g.amount - amount).toFixed(precision()) > (.000000005 * g.exchange * multiplier()).toFixed(precision())
+ difference = parseFloat(Math.abs(g.amount - amount).toFixed(precision()))
+ tolerance = parseFloat((.000000005 * g.exchange * multiplier()).toFixed(precision()))
+ if difference > tolerance
$('#amount').val(amount)
else
$('#amount').val(g.amount)