Skip to content

Commit 8f95d83

Browse files
MOL-746
1 parent 69d7b36 commit 8f95d83

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

processor/src/utils/mollie.utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ export const makeCTMoney = (mollieAmount: Amount): CTMoney => {
2929
type: 'centPrecision',
3030
currencyCode: mollieAmount.currency,
3131
// If the value is negative, round down, else round up
32-
centAmount:
33-
convertedMollieAmountValue > 0 ? Math.ceil(convertedMollieAmountValue) : Math.floor(convertedMollieAmountValue),
32+
centAmount: Math.round(convertedMollieAmountValue),
3433
fractionDigits,
3534
};
3635
};

processor/tests/utils/mollie.utils.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe('Test mollie.utils.ts', () => {
106106
const expected: CTMoney = {
107107
type: 'centPrecision',
108108
currencyCode: 'EUR',
109-
centAmount: Math.ceil(12.345 * 1000),
109+
centAmount: Math.round(12.345 * 1000),
110110
fractionDigits: 3,
111111
};
112112

0 commit comments

Comments
 (0)