News:

Support the VirtueMart project and become a member

Main Menu

Cannot set certain price

Started by Kuubs, October 11, 2020, 11:07:25 AM

Previous topic - Next topic

Kuubs

Hello,

I have some odd behaviour, i have a tax of 21% and a product price of 59,95. But I cannot seem to set this price exactly, it's or 59,96 or 59,94. I think it has to do with using the base price and using that base price as calculation for the final price:

49,55 * 1,21 = 59,9555 = rounded 59,96

if I remove one cent from that:

49,54 * 1,21 = 59,9434 = rounded 59,94

So I cannot seem to get the actual 59,95, I tried checking the database but that is not possible as well. It uses the base price with only 2 decimals to calculate the final price, instead of just ising the cost price with more than 2 decimals to get a more precise calculation. How can I fix this?

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Kuubs

#2
Quote from: GJC Web Design on October 11, 2020, 11:21:44 AM
calc the cost price!!!
Yes I do that, it does not work. It automatically adds 1 cent.

I did some digging, and it seems this new behaviour is added in the new version of Virtuemart, this didn't happen in older versions. Seems to me that a lot of things are buggy right now. I also made another topic regarding coupons where category selection is bugged.

EDIT: Found the solution! There is a configuration at the prices where it can round the prices only on display or not, that was turned off. So it began rounding before the display!

pinochico

QuoteSo it began rounding before the display!

I may be wrong, but if I turn on this checkbox, all price operations will always be rounded, and then an error of tens of units may occur in the cart.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Kuubs

Quote from: pinochico on October 11, 2020, 14:25:10 PM
QuoteSo it began rounding before the display!

I may be wrong, but if I turn on this checkbox, all price operations will always be rounded, and then an error of tens of units may occur in the cart.

No it never rounds the price operations. When you turn on the checkbox it rounds all price operations. So that is why I couldn't get a certain price.