matthiask / plata

Plata - the lean and mean Django-based Shop
https://plata-django-shop.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
197 stars 63 forks source link

DecimalField #54

Closed lostb1t closed 11 years ago

lostb1t commented 11 years ago

Is it maybe possible to override the decimal fields so it can be limit to a standard of 4 digits and and 2 decimal? Its now rounding to an extreme amount of digits (14) wich is confusing in the backed for admins. Or do i have to override the processors to round it?

matthiask commented 11 years ago

Hi! Currently that's not possible. You can override the processors to round it if you really need it.

However, the precision is really necessary to prevent rounding errors later on. Maybe 18 digits with 10 decimal places is overkill BUT I managed a shop with only 4-5 digits and we had (real) rounding errors all the time leading to unpaid orders because of a missing cent.

We mostly use prices including tax, and because the values are stored excl. tax, the precision is somewhat necessary. The PDFs generated and the frontend do never show more than two decimal digits though, and we just tell everyone to stick to that.

lostb1t commented 11 years ago

Alright thank you for the explanation.