hotfix: round totals (#188)

* fix: round totals

* fix: test
This commit is contained in:
Sebastian Rindom authored and GitHub committed 2021-02-27 11:14:39 +01:00
1 parent ed5b1592a4
commit 7f5ee6bdcc
2 files changed
+2 -5

No files matched your search

@@ -377,7 +377,7 @@ describe("TotalsService", () => {
},
])
expect(res).toEqual(1243.75)
expect(res).toEqual(1244)
})
it("calculates refund with item fixed discount", async () => {
+1 -4
View File
@@ -328,10 +328,7 @@ class TotalsService extends BaseService {
}
rounded(value) {
const decimalPlaces = 4
return Number(
Math.round(parseFloat(value + "e" + decimalPlaces)) + "e-" + decimalPlaces
)
return Math.round(value)
}
}