Incorrect cart total

Issue #1426 open
John Boyd
created an issue


I recently istarted learning Satchmo/django and installed Satchmo on Freebsd 8.

After about the 3rd. item, my cart adds .01 to the total.

All items are $50.00, default tax 15%, no discount.

python version 2.7

django.VERSION (1, 3, 1, 'final', 0) satchmo_store.get_version() '0.9-1 hg-unknown'

I realized after I did a lot of work that this is not the most recent release of Satchmo.

Do I have to upgrade or is it solvable with current install?

Best regards,

John Boyd

Comments (2)

  1. Hynek Cernoch

    Is acceptabe for you to use more decimal places for untaxed price? You can use up to 6 decimal places. If you use 4 places, it will be exact up to 86 items or pieces in the worsest case. If you use 6 decimal places, it is exact up to 8600 items or pieces.

    50.00 / 1.15 = 43.478261
    43.48 * 1.15 * 5 = 250.01

    With 2 given decimal places is not sure even for one item in some cases:

    80.00 / 1.15 = 69.565217
    69.57 * 1.15 = 80.0055 what is rounded to 80.01
    -  Or if you intentionally enter a value rounded down
    69.56 * 1.15 = 79.9940 what is rounded to 79.99

    Satchmo version is not important for this. Rounding method is also not important. I can improve some value and make worse the other. The solution is to use more decimal places.

    The admin can be customized so that nice taxed prices can be alternatively entered and ugly precise untaxed values are automatically calculated and saved.

  2. John Boyd reporter

    Hello Hynek,

    Sorry for taking so long to reply, I am simultaneously learning how to do development using virtualenvwrapper, fossil and set up virtualhosts and wsgi. Whew! I finally figured it out today.

    With regard to your proposal, I think it make things much easier. In my country not all items are taxed(Vat), so you must still be able to put in prices manually for untaxed items.

    This leads to invoice/cart showing which items are taxed and which are not.

    A local grocery's invoice usually show a "T" next to the taxed items. This might be a good pattern to use.

    Finally, I was able to show the correct totals, if, in my tax settings - tax calculated on "billing" address, and "show with tax included" is not ticked therefore "False"

    Best regards,


  3. Log in to comment