aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2015-11-27 23:46:10 -0800
committerAdam Soltys <[email protected]>2015-11-27 23:46:10 -0800
commitf2bff842cbe16c18923b905f70ed168096648727 (patch)
treef69dc6b18ef461a6c41039852482987da7e40060
parent380aaff0c48b2f1ac382efd4dba065d4634271ea (diff)
downloadcoinos-server-f2bff842cbe16c18923b905f70ed168096648727.tar.gz
coinos-server-f2bff842cbe16c18923b905f70ed168096648727.zip
Set max value
-rw-r--r--public/js/wallet.coffee7
1 files changed, 5 insertions, 2 deletions
diff --git a/public/js/wallet.coffee b/public/js/wallet.coffee
index 5df361a2..81cd1100 100644
--- a/public/js/wallet.coffee
+++ b/public/js/wallet.coffee
@@ -51,7 +51,7 @@ $(->
amount = (g.amount * g.exchange / multiplier()).toFixed(2)
$('#amount').val(amount)
$('#amount').attr('step', 0.01)
- $('#amount').attr('max', g.balance * g.exchange / multiplier())
+ $('#amount').attr('max', (g.balance * g.exchange / multiplier()).toFixed(2))
else
$(this).html(g.user.unit)
$('#amount').val(convertedAmount())
@@ -73,6 +73,9 @@ $(->
$(this).val(parseFloat($(this).val()).toFixed(precision()))
else
$(this).val(parseFloat($(this).val()).toFixed(2))
+
+ if $(this).val() > $(this).attr('max')
+ $(this).val($(this).attr('max'))
)
)
@@ -159,7 +162,7 @@ sendTransaction = ->
convertedAmount = ->
amount = parseFloat($('#amount').val() * multiplier() / g.exchange).toFixed(precision())
difference = parseFloat(Math.abs(g.amount - amount).toFixed(precision()))
- tolerance = parseFloat((.000000005 * g.exchange * multiplier()).toFixed(precision()))
+ tolerance = parseFloat((.00000002 * g.exchange * multiplier()).toFixed(precision()))
if difference > tolerance
return amount
else