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

#   Condition issue?

##

- **[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")**
- [![Lumiga's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar31479.png)](/forum/user/31479-lumiga "View Lumiga's Profile") Topic Author
- [ Offline](/forum/user/31479-lumiga)

Less More

- Posts: 637
- Thank you received: 26
-
-
-

1 year 1 month ago -  1 year 1 month ago [\#368907](#368907) by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")  *[Condition issue?](/forum/25-install-update/909778-condition-issue#368907 "-- HikaShop version -- : 6.1.0 -- Joomla version -- : 5.3.4 -- PHP version -- : 8.3  Hi HikaShop team,  I’m experiencing an issue with a price calculation condition using decimal values.  Here’s the condition I’m trying to use:  When {shape} has a value like 0.4, the condition does not work. However, when I change the value from the shape into (for example 2), the condition works correctly.  So it looks like decimal numbers (with a dot) are not being parsed or compared properly inside conditions, while integers are.  But also, why will these conditions don't work?  Thanks in advance for your help!  Best regards, Lumiga")* was created by *[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")*

-- HikaShop version -- : 6.1.0
-- Joomla version -- : 5.3.4
-- PHP version -- : 8.3

Hi HikaShop team,

I’m experiencing an issue with a price calculation condition using decimal values.

Here’s the condition I’m trying to use:
Code:

{shape}&gt;0.3 &amp;&amp; {afwerking_zelfklevend_alu}&gt;0

When {shape} has a value like 0.4, the condition does not work.
However, when I change the value from the shape into (for example 2), the condition works correctly.

So it looks like decimal numbers (with a dot) are not being parsed or compared properly inside conditions, while integers are.

But also, why will these conditions don't work?
Code:

{shape}=0.4 {shape}="0.4"

Thanks in advance for your help!

Best regards,
Lumiga

[ ![screenshot-27.png](/forum/attachment/60884) ](/forum/attachment/60884 "screenshot-27.png")

---

Kind regards,
Lumiga

- [ ![screenshot-27.png](/forum/attachment/60884) ](/forum/attachment/60884 "screenshot-27.png") [ ](/forum/attachment/60884?download=1 "screenshot-27.png")

Last edit: 1 year 1 month ago by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwOTc3OC1jb25kaXRpb24taXNzdWU/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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86363
- Thank you received: 14296
-
-

1 year 1 month ago [\#368908](#368908) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Condition issue?](/forum/25-install-update/909778-condition-issue#368908 "-- HikaShop version -- : 6.1.0 -- Joomla version -- : 5.3.4 -- PHP version -- : 8.3  Hi HikaShop team,  I’m experiencing an issue with a price calculation condition using decimal values.  Here’s the condition I’m trying to use:  When {shape} has a value like 0.4, the condition does not work. However, when I change the value from the shape into (for example 2), the condition works correctly.  So it looks like decimal numbers (with a dot) are not being parsed or compared properly inside conditions, while integers are.  But also, why will these conditions don't work?  Thanks in advance for your help!  Best regards, Lumiga")*

Hi,

Ideally, I would recommend avoiding decimals as much as possible with PHP. That will avoid issues.
You could multiply everything by 100 here. That way, you would have the values 3 and 40 and in the condition, you would have {shape}&gt;30 and it would be mathematically the same, but without any decimals. And if you need to use {shape} in the formula, you can always divide it by 100 in the formula.

However, your custom field can have both strings and numbers: 0.4 and 0.03 are numbers but overig is a string.
And then you're using &gt; in the condition. But "overid &gt; 0.3" doesn't make sense since you can't mathematically compare a word and a number.
That might actually be a bigger problem here.

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

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