Skip to content
This repository was archived by the owner on Sep 20, 2025. It is now read-only.

Commit 0afb26d

Browse files
committed
Improve number rounding
1 parent 03f8e0f commit 0afb26d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/models/v1/shipping.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module.exports = (sequelize, DataTypes) => {
4141

4242
let result = (part[0].count / whole[0].count) * 100;
4343
if (0 < result) {
44-
result = Math.round(result * 100) / 100;
44+
result = Math.round((result + Number.EPSILON) * 100) / 100;
4545
}
4646
return { percentage: result + "%" };
4747
} catch(err) {

0 commit comments

Comments
 (0)