The use of `Math.round()` when setting the price always results in whole numbers, regardless of the exact calculation.

Comments

daggerhart created an issue. See original summary.

daggerhart’s picture

Status: Active » Needs review
StatusFileSize
new428 bytes

Attached 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.

  • potop committed be886fd on 7.x-1.x authored by daggerhart
    Issue #3003895 by daggerhart: Javascript rounds prices to whole numbers
    
potop’s picture

Assigned: Unassigned » potop
Status: Needs review » Reviewed & tested by the community

  • potop committed 369b997 on 7.x-1.x
    Issue #3003895: Separate setting introduced for admin area total...
potop’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in dev branch.
Separate setting introduced for admin area total rounding precision.

potop’s picture

Status: Fixed » Reviewed & tested by the community

@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.

potop’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

daggerhart’s picture

Even better. Updated and tested out, seems to be working well, thanks for the fix!