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

#   rounding problem

##

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

Less More

- Posts: 41
- Thank you received: 2
-
-

2 years 9 months ago [\#358907](#358907) by [frik](/forum/user/52036-frik "View frik's Profile")  *[rounding problem](/forum/40-taxes/907716-rounding-problem#358907 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 4.1.2 -- PHP version -- : 7.4.33 -- Browser(s) name and version -- : chrome latest, firefox, etc. -- Error-message(debug-mod must be tuned on) -- : no error message  Hi there!  I encountered a rounding issue.  If there's a product priced at, say, 536.41 forints (HUF), it rounds it to 536 forints gross. However, the issue arises when someone buys two of these products, which would amount to 1073 forints, as the gross value is actually 1072.82. Now, if I don't round it up with Hikashop to 1073, the Barion (payment module) rejects it with an error, and it's impossible to make a payment on the website (in Hungary, non-whole numbers cannot be used for payments, unlike Euro cents). But if I round it up, it disregards the decimal value (from 1072.82, it only takes 1072 HUF), and thus 1 HUF is lost. However, Barion only accepts the value if we round up the prices beforehand.  The more one orders, the greater the discrepancy.  Thanks in advance! FRIK")* was created by *[frik](/forum/user/52036-frik "View frik's Profile")*

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.1.2
-- PHP version -- : 7.4.33
-- Browser(s) name and version -- : chrome latest, firefox, etc.
-- Error-message(debug-mod must be tuned on) -- : no error message

Hi there!

I encountered a rounding issue.

If there's a product priced at, say, 536.41 forints (HUF), it rounds it to 536 forints gross. However, the issue arises when someone buys two of these products, which would amount to 1073 forints, as the gross value is actually 1072.82. Now, if I don't round it up with Hikashop to 1073, the Barion (payment module) rejects it with an error, and it's impossible to make a payment on the website (in Hungary, non-whole numbers cannot be used for payments, unlike Euro cents). But if I round it up, it disregards the decimal value (from 1072.82, it only takes 1072 HUF), and thus 1 HUF is lost. However, Barion only accepts the value if we round up the prices beforehand.

The more one orders, the greater the discrepancy.

Thanks in advance!
FRIK

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzkwNzcxNi1yb3VuZGluZy1wcm9ibGVtP3RtcGw9bWFya2Rvd24=) 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: 86363
- Thank you received: 14296
-
-

2 years 9 months ago [\#358910](#358910) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[rounding problem](/forum/40-taxes/907716-rounding-problem#358910 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 4.1.2 -- PHP version -- : 7.4.33 -- Browser(s) name and version -- : chrome latest, firefox, etc. -- Error-message(debug-mod must be tuned on) -- : no error message  Hi there!  I encountered a rounding issue.  If there's a product priced at, say, 536.41 forints (HUF), it rounds it to 536 forints gross. However, the issue arises when someone buys two of these products, which would amount to 1073 forints, as the gross value is actually 1072.82. Now, if I don't round it up with Hikashop to 1073, the Barion (payment module) rejects it with an error, and it's impossible to make a payment on the website (in Hungary, non-whole numbers cannot be used for payments, unlike Euro cents). But if I round it up, it disregards the decimal value (from 1072.82, it only takes 1072 HUF), and thus 1 HUF is lost. However, Barion only accepts the value if we round up the prices beforehand.  The more one orders, the greater the discrepancy.  Thanks in advance! FRIK")*

Hi,

First, it should be up to the payment plugin you're using to round the total amount based on the capabilities of the payment gateway.

Second, when you edit your currency in the menu System&gt;Currencies, you can edit your currency and enter the number of decimals. If you set it to 0 it will round the prices when displayed on the frontend.
Then, you have the "round prices during calculations" setting in the HikaShop configuration.
What you're describing indicates that you've activated this setting and thus, the prices are rounded before being summed.
However, with that setting turned off, 536.41 would still be rounded to 536 on display, but 536.41+536.41 would be displayed as 1073 since the rounding would happen on display, after the calculation is made.
However, in that case, the order_full_total value of the order will still be 1072.82 in the database. So that means that it still requires the payment plugin to do the rounding too when passing the value to the payment gateway.

So, either way, I suggest contacting the developer of the payment plugin to properly round the total amount so that it is compatible with the payment gateway if the total amount has more decimals than possible with that payment gateway.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQwLXRheGVzLzkwNzcxNi1yb3VuZGluZy1wcm9ibGVtP3RtcGw9bWFya2Rvd24=) 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.080 seconds

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