Inconsistent rounding in si2026 compare to si2020

SimpleInvoices Group Forum Forums Fearless359 SimpleInvoices Discussion Group Inconsistent rounding in si2026 compare to si2020

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2357
    Lapi
    Participant

    Hello,

    In version simpleinvoices 2020, If I enter 1*$58.18, it returns $64.00, and if I enter 8*$58.18, it returns $512.00, which is what I want.

    If in version simpleinvoices 2026 I enter 1*$58.18, it returns $64.00, and if I enter 8*$58.18, it returns $511.98, while I want to see $512.00

    I can’t see any directly accessible settings about it.
    How to make v2026 behave like v2020?

    Is there a php setting to adjust? Or else…?

    v2026 is installed on ANTIX linux (debian based without systemd), mariadb and php 8.5.

    Thank you.

    #2358
    fearless359
    Keymaster

    Where are these values entered? I assumed the quantity and unit price for an invoice item. In which case you get 58.18 and 465.44 respectively. Which agrees with my calculator. Maybe a picture is needed to show the what you are doing.

    #2360
    Lapi
    Participant

    I should have mentioned the 10% GST(tax)
    1*$58.18*1.1 = $64.00

    #2361
    Lapi
    Participant

    Please find a screenshot of the operation

    #2363
    Lapi
    Participant

    Hello,

    I believe I now understand how the internal calculation is performed:

    The tax is calculated at the end and added to the total of all line items (excluding tax), rather than being computed line by line and then summed. This likely explains why the result is rounded up in this example for times 1 and 2, as well as time 501. In other cases, the value remains below XXX.995 after the third decimal place.

    It appears that the system rounds up when the third digit after the decimal point is 995 or higher.

    Unless the user can select an alternative method of tax calculation or rounding in the settings, it may be preferable to leave the current behaviour unchanged, as implementing such an option would require considerable effort and may not be of interest to most users.

    Thank you for your great support,
    Best regards

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.