The use of `Math.round()` when setting the price always results in whole numbers, regardless of the exact calculation.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3003895-javascript-rounds-whole-numbers.patch | 428 bytes | daggerhart |
The use of `Math.round()` when setting the price always results in whole numbers, regardless of the exact calculation.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3003895-javascript-rounds-whole-numbers.patch | 428 bytes | daggerhart |
Comments
Comment #2
daggerhart commentedAttached patch replaces `Math.round(price)` with `price.toFixed(2)` so that decimals more respected. This may still be imperfect calculations for the price, but appear much more exact than the current whole numbers.
Comment #4
potop commentedComment #6
potop commentedFixed in dev branch.
Separate setting introduced for admin area total rounding precision.
Comment #7
potop commented@daggerhart Thank you for the patch.
I've introduced a setting for rounding precision so the module could support currencies which has minor value of what is behind decimal point.
Comment #8
potop commentedComment #10
daggerhart commentedEven better. Updated and tested out, seems to be working well, thanks for the fix!