diff --git a/changes/mario_3376-fix-rewards-decimals b/changes/mario_3376-fix-rewards-decimals new file mode 100644 index 0000000000..a9130f56a5 --- /dev/null +++ b/changes/mario_3376-fix-rewards-decimals @@ -0,0 +1 @@ +[Fixed] [#3376](https://github.com/cosmos/lunie/issues/3376) Round total rewards to 6 decimal places @mariopino \ No newline at end of file diff --git a/src/ActionModal/components/ModalWithdrawRewards.vue b/src/ActionModal/components/ModalWithdrawRewards.vue index fc033e335e..415977ecec 100644 --- a/src/ActionModal/components/ModalWithdrawRewards.vue +++ b/src/ActionModal/components/ModalWithdrawRewards.vue @@ -63,7 +63,9 @@ export default { } }, totalRewards() { - return this.rewards.reduce((sum, { amount }) => sum + Number(amount), 0) + return this.rewards + .reduce((sum, { amount }) => sum + Number(amount), 0) + .toFixed(6) }, notifyMessage() { return { diff --git a/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap b/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap index f3de3fc2b1..0c1303fc37 100644 --- a/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap +++ b/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap @@ -229,7 +229,9 @@ exports[`ActionModal should show the action modal on success 1`] = ` success="true" >