fix #1501 wallet: display right fee amount

This commit is contained in:
Herich 2017-07-27 12:45:25 +02:00 committed by Roman Volosovskyi
parent f185fa4190
commit d90dab8711
1 changed files with 4 additions and 1 deletions

View File

@ -6,7 +6,10 @@ function calculateFee(n, tx) {
var gasMultiplicator = Math.pow(1.4, n).toFixed(3);
var weiFee = web3.eth.gasPrice * gasMultiplicator * estimatedGas;
return parseFloat(web3.fromWei(weiFee, "ether")).toFixed(7);
// force fee in eth to be of BigNumber type
var ethFee = web3.toBigNumber(web3.fromWei(weiFee, "ether"));
// always display 7 decimal places
return ethFee.toFixed(7);
}
function calculateGasPrice(n) {