[Skip to main content](#vessel-content)

#   Discount percentage and price rounding

##

- **[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")**
- [![bmichu's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32093-bmichu "View bmichu's Profile") Topic Author
- [ Offline](/forum/user/32093-bmichu)

Less More

- Posts: 71
- Thank you received: 0
-
-

11 years 2 months ago [\#214057](#214057) by [bmichu](/forum/user/32093-bmichu "View bmichu's Profile")  *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214057 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")* was created by *[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")*

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1

Hi,

For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?

Thanks.
Michel

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86556
- Thank you received: 14304
-
-

11 years 2 months ago [\#214062](#214062) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214062 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

Did you configure a rounding increment of 0.05 in the settings page of your currency that you can edit via the menu System&gt;Currencies ?
If not, then it's normal that it round the prices by 0.01 increments as that's the default rounding increment of the system.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")**
- [![bmichu's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32093-bmichu "View bmichu's Profile") Topic Author
- [ Offline](/forum/user/32093-bmichu)

Less More

- Posts: 71
- Thank you received: 0
-
-

11 years 2 months ago [\#214088](#214088) by [bmichu](/forum/user/32093-bmichu "View bmichu's Profile")  Replied by *[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214088 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi Nicolas,

As you can see from the screenshots below, the increment is set to 0.05, but the discounted prices are still shown with a 0.01 rounding...

Thanks,
Michel

- [ ![hika1.png](/forum/attachment/26426) ](/forum/attachment/26426 "hika1.png") [ ](/forum/attachment/26426?download=1 "hika1.png")
- [ ![hika2.png](/forum/attachment/26427) ](/forum/attachment/26427 "hika2.png") [ ](/forum/attachment/26427?download=1 "hika2.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86556
- Thank you received: 14304
-
-

11 years 2 months ago [\#214110](#214110) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214110 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

Ok, I see the issue.
Can you try to change the code: Code:

function addDiscount(&amp;$price, &amp;$discount, $discount_before_tax, $zone_id, $product_tax_id) { $config = hikashop_config(); if($config-&gt;get('floating_tax_prices', 0)) { $price-&gt;price_value = $price-&gt;price_value_with_tax; } $price-&gt;price_value_without_discount = $price-&gt;price_value; if($discount_before_tax) { if(bccomp($discount-&gt;discount_flat_amount,0,5) !== 0) { $price-&gt;price_value = $price-&gt;price_value -floatval($discount-&gt;discount_flat_amount); } else { $price-&gt;price_value = (($price-&gt;price_value * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); if(isset($price-&gt;price_orig_value)) { $price-&gt;price_orig_value_without_discount = $price-&gt;price_orig_value; $price-&gt;price_orig_value = (($price-&gt;price_orig_value * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); } } $price-&gt;price_value_without_discount_with_tax = $this-&gt;getTaxedPrice($price-&gt;price_value_without_discount, $zone_id, $product_tax_id); $price-&gt;taxes_without_discount = $this-&gt;taxRates; $price-&gt;price_value_with_tax = $this-&gt;getTaxedPrice($price-&gt;price_value, $zone_id, $product_tax_id); $price-&gt;taxes = $this-&gt;taxRates; if(isset($price-&gt;price_orig_value)) { $price-&gt;price_orig_value_with_tax = $this-&gt;getTaxedPrice($price-&gt;price_orig_value, $zone_id, $product_tax_id); $price-&gt;taxes_orig = $this-&gt;taxRates; } } else { $price-&gt;price_value_without_discount_with_tax = $price-&gt;price_value_with_tax; if(bccomp($discount-&gt;discount_flat_amount, 0, 5) !== 0) { $price-&gt;price_value_with_tax = $price-&gt;price_value_with_tax - floatval($discount-&gt;discount_flat_amount); } else { $price-&gt;price_value_with_tax = (($price-&gt;price_value_with_tax * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); if(isset($price-&gt;price_orig_value_with_tax)) { $price-&gt;price_orig_value_without_discount_with_tax = $price-&gt;price_orig_value_with_tax; $price-&gt;price_orig_value_with_tax = (($price-&gt;price_orig_value_with_tax * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); } } $price-&gt;price_value_without_discount = $this-&gt;getUntaxedPrice($price-&gt;price_value_without_discount_with_tax, $zone_id, $product_tax_id); $price-&gt;taxes_without_discount = $this-&gt;taxRates; $price-&gt;price_value = $this-&gt;getUntaxedPrice($price-&gt;price_value_with_tax,$zone_id,$product_tax_id); $price-&gt;taxes = $this-&gt;taxRates; if(isset($price-&gt;price_orig_value_with_tax)) { $price-&gt;price_orig_value = $this-&gt;getUntaxedPrice($price-&gt;price_orig_value_with_tax, $zone_id, $product_tax_id); $price-&gt;taxes_orig = $this-&gt;taxRates; } } }

to: Code:

function addDiscount(&amp;$price, &amp;$discount, $discount_before_tax, $zone_id, $product_tax_id) { $config = hikashop_config(); if($config-&gt;get('floating_tax_prices', 0)) { $price-&gt;price_value = $price-&gt;price_value_with_tax; } $price-&gt;price_value_without_discount = $price-&gt;price_value; $round = $this-&gt;getRounding(@$price-&gt;price_currency_id,true); if($discount_before_tax) { if(bccomp($discount-&gt;discount_flat_amount,0,5) !== 0) { $price-&gt;price_value = $price-&gt;price_value -floatval($discount-&gt;discount_flat_amount); } else { $price-&gt;price_value = (($price-&gt;price_value * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); if(isset($price-&gt;price_orig_value)) { $price-&gt;price_orig_value_without_discount = $price-&gt;price_orig_value; $price-&gt;price_orig_value = (($price-&gt;price_orig_value * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); } } $price-&gt;price_value_without_discount_with_tax = $this-&gt;getTaxedPrice($price-&gt;price_value_without_discount, $zone_id, $product_tax_id, $round); $price-&gt;taxes_without_discount = $this-&gt;taxRates; $price-&gt;price_value_with_tax = $this-&gt;getTaxedPrice($price-&gt;price_value, $zone_id, $product_tax_id, $round); $price-&gt;taxes = $this-&gt;taxRates; if(isset($price-&gt;price_orig_value)) { $price-&gt;price_orig_value_with_tax = $this-&gt;getTaxedPrice($price-&gt;price_orig_value, $zone_id, $product_tax_id, $round); $price-&gt;taxes_orig = $this-&gt;taxRates; } } else { $price-&gt;price_value_without_discount_with_tax = $price-&gt;price_value_with_tax; if(bccomp($discount-&gt;discount_flat_amount, 0, 5) !== 0) { $price-&gt;price_value_with_tax = $price-&gt;price_value_with_tax - floatval($discount-&gt;discount_flat_amount); } else { $price-&gt;price_value_with_tax = (($price-&gt;price_value_with_tax * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); if(isset($price-&gt;price_orig_value_with_tax)) { $price-&gt;price_orig_value_without_discount_with_tax = $price-&gt;price_orig_value_with_tax; $price-&gt;price_orig_value_with_tax = (($price-&gt;price_orig_value_with_tax * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); } } $price-&gt;price_value_without_discount = $this-&gt;getUntaxedPrice($price-&gt;price_value_without_discount_with_tax, $zone_id, $product_tax_id, $round); $price-&gt;taxes_without_discount = $this-&gt;taxRates; $price-&gt;price_value = $this-&gt;getUntaxedPrice($price-&gt;price_value_with_tax,$zone_id,$product_tax_id, $round); $price-&gt;taxes = $this-&gt;taxRates; if(isset($price-&gt;price_orig_value_with_tax)) { $price-&gt;price_orig_value = $this-&gt;getUntaxedPrice($price-&gt;price_orig_value_with_tax, $zone_id, $product_tax_id, $round); $price-&gt;taxes_orig = $this-&gt;taxRates; } } }

in the file administrator/components/com_hikashop/classes/currency.php and see if that helps ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")**
- [![bmichu's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32093-bmichu "View bmichu's Profile") Topic Author
- [ Offline](/forum/user/32093-bmichu)

Less More

- Posts: 71
- Thank you received: 0
-
-

11 years 2 months ago [\#214207](#214207) by [bmichu](/forum/user/32093-bmichu "View bmichu's Profile")  Replied by *[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214207 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi Nicolas,

Thanks for the reply!
Unfortunately it doesn't work. See result in Screenshot.

Thanks,
Michel

- [ ![hika1&#95;2015-09-15.png](/forum/attachment/26463) ](/forum/attachment/26463 "...2015-09-15.png") [ ](/forum/attachment/26463?download=1 "...2015-09-15.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86556
- Thank you received: 14304
-
-

11 years 1 month ago [\#214258](#214258) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214258 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

It seems to be working way better than before though on your screenshot.
I see however on my end that the price with tax isn't rounded as it should.
With that code however, it works fine on my end: Code:

function addDiscount(&amp;$price, &amp;$discount, $discount_before_tax, $zone_id, $product_tax_id) { $config = hikashop_config(); if($config-&gt;get('floating_tax_prices', 0)) { $price-&gt;price_value = $price-&gt;price_value_with_tax; } $price-&gt;price_value_without_discount = $price-&gt;price_value; $round = $this-&gt;getRounding(@$price-&gt;price_currency_id,true); if($discount_before_tax) { if(bccomp($discount-&gt;discount_flat_amount,0,5) !== 0) { $price-&gt;price_value = $price-&gt;price_value -floatval($discount-&gt;discount_flat_amount); } else { $price-&gt;price_value = (($price-&gt;price_value * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); if(isset($price-&gt;price_orig_value)) { $price-&gt;price_orig_value_without_discount = $price-&gt;price_orig_value; $price-&gt;price_orig_value = (($price-&gt;price_orig_value * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); } } $price-&gt;price_value_without_discount_with_tax = $this-&gt;getTaxedPrice($price-&gt;price_value_without_discount, $zone_id, $product_tax_id, $round); $price-&gt;taxes_without_discount = $this-&gt;taxRates; $price-&gt;price_value_with_tax = $this-&gt;getTaxedPrice($price-&gt;price_value, $zone_id, $product_tax_id, $round); $price-&gt;price_value = $this-&gt;round($price-&gt;price_value, $round); $price-&gt;taxes = $this-&gt;taxRates; if(isset($price-&gt;price_orig_value)) { $price-&gt;price_orig_value_with_tax = $this-&gt;getTaxedPrice($price-&gt;price_orig_value, $zone_id, $product_tax_id, $round); $price-&gt;taxes_orig = $this-&gt;taxRates; } } else { $price-&gt;price_value_without_discount_with_tax = $price-&gt;price_value_with_tax; if(bccomp($discount-&gt;discount_flat_amount, 0, 5) !== 0) { $price-&gt;price_value_with_tax = $price-&gt;price_value_with_tax - floatval($discount-&gt;discount_flat_amount); } else { $price-&gt;price_value_with_tax = (($price-&gt;price_value_with_tax * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); if(isset($price-&gt;price_orig_value_with_tax)) { $price-&gt;price_orig_value_without_discount_with_tax = $price-&gt;price_orig_value_with_tax; $price-&gt;price_orig_value_with_tax = (($price-&gt;price_orig_value_with_tax * (100.0 - floatval($discount-&gt;discount_percent_amount))) / 100.0); } } $price-&gt;price_value_without_discount = $this-&gt;getUntaxedPrice($price-&gt;price_value_without_discount_with_tax, $zone_id, $product_tax_id, $round); $price-&gt;taxes_without_discount = $this-&gt;taxRates; $price-&gt;price_value = $this-&gt;getUntaxedPrice($price-&gt;price_value_with_tax,$zone_id,$product_tax_id, $round); $price-&gt;price_value_with_tax = $this-&gt;round($price-&gt;price_value_with_tax, $round); $price-&gt;taxes = $this-&gt;taxRates; if(isset($price-&gt;price_orig_value_with_tax)) { $price-&gt;price_orig_value = $this-&gt;getUntaxedPrice($price-&gt;price_orig_value_with_tax, $zone_id, $product_tax_id, $round); $price-&gt;taxes_orig = $this-&gt;taxRates; } } }

So please try it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")**
- [![bmichu's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32093-bmichu "View bmichu's Profile") Topic Author
- [ Offline](/forum/user/32093-bmichu)

Less More

- Posts: 71
- Thank you received: 0
-
-

11 years 1 month ago [\#214380](#214380) by [bmichu](/forum/user/32093-bmichu "View bmichu's Profile")  Replied by *[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214380 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi Nicolas,

With the code before no discount was deducted.
With the new code you sent, it's the same as before (see screenshot), the prices are not rounded to nearest 0.05.

Thanks,
Michel

- [ ![hika1&#95;2015-09-16.png](/forum/attachment/26500) ](/forum/attachment/26500 "...2015-09-16.png") [ ](/forum/attachment/26500?download=1 "...2015-09-16.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86556
- Thank you received: 14304
-
-

11 years 1 month ago [\#214384](#214384) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214384 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

I'm not able to reproduce the problem on my end.
Please provide:
- a link to the page with the issue
- a backend access to check your settings
- a FTP access to your website so that we can look and modify the code
[ www.hikashop.com/support/contact-us.html](http://www.hikashop.com/support/contact-us.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")**
- [![bmichu's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32093-bmichu "View bmichu's Profile") Topic Author
- [ Offline](/forum/user/32093-bmichu)

Less More

- Posts: 71
- Thank you received: 0
-
-

11 years 1 month ago [\#214456](#214456) by [bmichu](/forum/user/32093-bmichu "View bmichu's Profile")  Replied by *[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214456 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

I've sent you the info via pm.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[florcar](/forum/user/35585-florcar "View florcar's Profile")**
- [![florcar's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35585-florcar "View florcar's Profile")
- [ Offline](/forum/user/35585-florcar)

Less More

- Posts: 62
- Thank you received: 1
-
-

11 years 1 month ago [\#214460](#214460) by [florcar](/forum/user/35585-florcar "View florcar's Profile")  Replied by *[florcar](/forum/user/35585-florcar "View florcar's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214460 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi
I had the same problem.
Maybe this will help:
[ www.hikashop.com/forum/checkout/876704-round-price.html](http://www.hikashop.com/forum/checkout/876704-round-price.html)
Regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86556
- Thank you received: 14304
-
-

11 years 1 month ago [\#214537](#214537) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#214537 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

I'm not able to access your backend. There is a htaccess authentication before the login screen and you didn't provide the credentials for that. Could you provide them too ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")**
- [![bmichu's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32093-bmichu "View bmichu's Profile") Topic Author
- [ Offline](/forum/user/32093-bmichu)

Less More

- Posts: 71
- Thank you received: 0
-
-

11 years 1 month ago [\#215544](#215544) by [bmichu](/forum/user/32093-bmichu "View bmichu's Profile")  Replied by *[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#215544 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Any news on this? I have sent you the credential per pm a week ago....

Thanks,
Michel

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

11 years 1 month ago [\#215552](#215552) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#215552 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

As Nicolas wrote one week ago ; we do not have any credentials for the Htaccess authentication for your backend.
You sent us a login and password for Joomla but that does not work for the first authentication part.
So please provide us that information and please use the "contact us" form, specially if you want us to be able to read your message.. Private message are inefficient for the support.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")**
- [![bmichu's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32093-bmichu "View bmichu's Profile") Topic Author
- [ Offline](/forum/user/32093-bmichu)

Less More

- Posts: 71
- Thank you received: 0
-
-

11 years 1 month ago [\#215610](#215610) by [bmichu](/forum/user/32093-bmichu "View bmichu's Profile")  Replied by *[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#215610 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

As I have written, I sent the credentials by pm, not being aware that it should have been sent through the contact form.
I have now sent them using the contact form.

Thanks,
Michel

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86556
- Thank you received: 14304
-
-

11 years 1 month ago [\#216066](#216066) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#216066 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

Sorry for the delay.
I was able to check your settings and indeed, the code modification I gave is correct and you correctly put it in place.
The issue is that you had turned off the "round prices during calculations" setting of the HikaShop configuration, and thus prices weren't rounded during the discount calculations anymore.
I've turned it on and the results are correct now on your website as far as I can see.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")**
- [![bmichu's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32093-bmichu "View bmichu's Profile") Topic Author
- [ Offline](/forum/user/32093-bmichu)

Less More

- Posts: 71
- Thank you received: 0
-
-

11 years 1 month ago -  11 years 1 month ago [\#216292](#216292) by [bmichu](/forum/user/32093-bmichu "View bmichu's Profile")  Replied by *[bmichu](/forum/user/32093-bmichu "View bmichu's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#216292 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

Great. Thanks! Could you tell me where this setting is? I can't find it....
How is it when I install an update of Hikashop? Will this modification be included or should I apply the changes again, after updating?

Michel

Last edit: 11 years 1 month ago by [bmichu](/forum/user/32093-bmichu "View bmichu's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

11 years 1 month ago [\#216305](#216305) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#216305 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

For the setting see : [ www.hikashop.com/support/support/documen...nfig.html#main\_taxes](http://www.hikashop.com/support/support/documentation/54-hikashop-config.html#main_taxes)

Otherwise, the fix that Nicolas gave you will be include in the next release.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lowcostwebagency](/forum/user/59226-lowcostwebagency "View lowcostwebagency's Profile")**
- [![lowcostwebagency's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/59226-lowcostwebagency "View lowcostwebagency's Profile")
- [ Offline](/forum/user/59226-lowcostwebagency)

Less More

- Posts: 3
- Thank you received: 0
-
-

6 years 2 months ago [\#323154](#323154) by [lowcostwebagency](/forum/user/59226-lowcostwebagency "View lowcostwebagency's Profile")  Replied by *[lowcostwebagency](/forum/user/59226-lowcostwebagency "View lowcostwebagency's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#323154 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

I am using latest version of hikashop and selected the option Round off with calcultion on hikashop configuration page.

My product price is 25,90 € and after applied the discount of 25% the amount will be 19.43 € and want to round of this value to 19.40 or 19.45 € .

Could you please tell me the way to get this value without changing the original price of the product and discount percentage.

Thanks,
Regards,
Vijay

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86556
- Thank you received: 14304
-
-

6 years 2 months ago [\#323213](#323213) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount percentage and price rounding](/forum/46-discount-coupon/879254-discount-percentage-and-price-rounding#323213 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi,  For certain customer groups we've set a discount of 25%. The discounted price however should be rounded to the nearest .05 eg. when the discounted price is 6.53, it should show 6.55 or with 6.52 it should show 6.50. How can this be achieved?  Thanks. Michel")*

Hi,

The rounding option in the Hikashop configuration is to have the prices rounded during calculations or not based on the rounding configured in the settings of the currency. So for example if you have a product costing 10.01 and you have a tax of 10% on top of that, it means the tax is 1.001 so it is rounded to 1. But suppose you have 10 elements of that product in the cart.
In that case, the total tax will either be 10 or 10.01 based on how that setting is configured.
So this setting has no influence on what you're trying to do.
By default the euro currency is configured with a rounding increment of 1 cent, so what you want to do, it's to edit the euro currency via the menu System&gt;Currencies and change the rounding increment from 0.01 to 0.05. That way, it will round prices with 5 cents steps instead of 1 cent steps.

The following user(s) said Thank You: [lowcostwebagency](/forum/user/59226-lowcostwebagency "View lowcostwebagency's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzkyNTQtZGlzY291bnQtcGVyY2VudGFnZS1hbmQtcHJpY2Utcm91bmRpbmc/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.129 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
