diff --git a/templates/page_js/send-token.js b/templates/page_js/send-token.js index 597944d..eed382f 100644 --- a/templates/page_js/send-token.js +++ b/templates/page_js/send-token.js @@ -26,14 +26,14 @@ function sendToken() { // Turn the amount into a float amount = BigNumber(amount); - if (amount <= 0) { + if (amount.comparedTo(0) <= 0) { errorMsg.innerHTML = 'Invalid amount!'; errorMsg.style.display = 'block'; return; } getVariable(contract, "balances", values[0]).then(balance => { - if (amount > BigNumber(balance)) { + if (amount.comparedTo(BigNumber(balance)) > 0) { errorMsg.innerHTML = 'Insufficient balance!'; errorMsg.style.display = 'block'; return; @@ -72,7 +72,7 @@ function sendToken() { status = 'error'; } - prependToTransactionHistory(hash, contract, 'transfer', {to: recipient, amount: amount}, status, new Date().toLocaleString()); + prependToTransactionHistory(hash, contract, 'transfer', {to: recipient, amount: {"__fixed__": amount.toFixed()}}, status, new Date().toLocaleString()); if (response['result']['code'] == 1) { errorMsg.innerHTML = response["result"]["log"];