Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-4531

Premature rounding of decimal config option quantities

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.1
    • Fix Version/s: 5.2.2
    • Component/s: None
    • Labels:
      None

      Description

      If you have a product with a config option of the type quantity such that:

      • There is a config option for say bandwidth
      • The per-unit price is $0.005, with a min of say 100, max of 1000
      • You order 500.

      Then:

      • The order form will correctly show that you have ordered 500x0.005 or $2.50 for the item
      • When you check out, the invoice will show a price of $5.00 for the item

      It appears that the fractional penny is rounded up to the nearest cent prior to being multiplied by the quantity. Interestingly, if you change the currency precision from 2 to 4, it is no longer an issue.

      If I'm right, it looks like we need to round these config option quantities AFTER we multiply the price times the quantity, not prior to multiplying by the quantity.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            abdy Abdy Franco
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Dec/21

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 days, 3 hours, 13 minutes
              2d 3h 13m

                Agile