diff --git a/src/js/ripple/transaction.js b/src/js/ripple/transaction.js index 89f0ed0d..6a9adf24 100644 --- a/src/js/ripple/transaction.js +++ b/src/js/ripple/transaction.js @@ -286,7 +286,7 @@ Transaction.prototype._computeFee = function() { var midInd = Math.floor(fees.length / 2); var median = fees.length % 2 === 0 - ? (fees[midInd] + fees[midInd - 1]) / 2 + ? Math.floor(0.5 + (fees[midInd] + fees[midInd - 1]) / 2) : fees[midInd]; return String(median); diff --git a/test/transaction-test.js b/test/transaction-test.js index d11997e0..5c8b065d 100644 --- a/test/transaction-test.js +++ b/test/transaction-test.js @@ -318,7 +318,7 @@ describe('Transaction', function() { assert(transaction.complete()); var json = transaction.serialize().to_json(); - assert(json.Fee != '66500000', 'Fee == 66500000, i.e. 66.5 XRP!'); + assert.notStrictEqual(json.Fee, '66500000', 'Fee == 66500000, i.e. 66.5 XRP!'); });