diff options
| author | Adam Soltys <[email protected]> | 2015-11-24 11:39:40 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2015-11-27 22:02:48 -0800 |
| commit | ed284b9ca93f03b9dc8fce3744baab59588d43f1 (patch) | |
| tree | 33b6555c5df41615ab8b25cd05871b9a517cd78e | |
| parent | 64298f7a55bc7a97e04658a10ed85e45b51520db (diff) | |
| download | coinos-server-ed284b9ca93f03b9dc8fce3744baab59588d43f1.tar.gz coinos-server-ed284b9ca93f03b9dc8fce3744baab59588d43f1.zip | |
Fix tolerance calculation
| -rw-r--r-- | public/js/wallet.coffee | 4 |
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) |
