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

#   Weight Decimal Places

##

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

Less More

- Posts: 135
- Thank you received: 5
-
-

4 years 5 months ago [\#342215](#342215) by [markfell](/forum/user/27962-markfell "View markfell's Profile")  *[Weight Decimal Places](/forum/26-product-category-display/904523-weight-decimal-places#342215 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.4 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : Brave Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)  Hi,  Can I change the decimal place in weights input display in the product restrictions and dimensions. I products weight very little, but need to be displayed at 0.0018Kgs as per the actual product description from the manufacturers.  If I enter that value 0.0018kgs the system rounds it to 0.002kg  Regards, MSG")* was created by *[markfell](/forum/user/27962-markfell "View markfell's Profile")*

-- HikaShop version -- : 4.5.1
-- Joomla version -- : 4.1.4
-- PHP version -- : 7.4.28
-- Browser(s) name and version -- : Brave Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)

Hi,

Can I change the decimal place in weights input display in the product restrictions and dimensions.
I products weight very little, but need to be displayed at 0.0018Kgs as per the actual product description from the manufacturers.

If I enter that value 0.0018kgs the system rounds it to 0.002kg

Regards,
MSG

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

4 years 5 months ago [\#342221](#342221) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Weight Decimal Places](/forum/26-product-category-display/904523-weight-decimal-places#342221 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.4 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : Brave Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)  Hi,  Can I change the decimal place in weights input display in the product restrictions and dimensions. I products weight very little, but need to be displayed at 0.0018Kgs as per the actual product description from the manufacturers.  If I enter that value 0.0018kgs the system rounds it to 0.002kg  Regards, MSG")*

Hi,

In your PHPMyAdmin, you need to open the table hikashop_product's structure and edit the product_weight column.
There, you need to change the type which is decimal(12,3) to for example decimal(14,5)
And that will allow you two more decimals in weights.
Another solution would be to use grams instead of Kgs. That way you could just enter 1.8 grams as the weight and it would work fine.

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

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

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

Less More

- Posts: 135
- Thank you received: 5
-
-

4 years 5 months ago [\#342233](#342233) by [markfell](/forum/user/27962-markfell "View markfell's Profile")  Replied by *[markfell](/forum/user/27962-markfell "View markfell's Profile")* on topic *[Weight Decimal Places](/forum/26-product-category-display/904523-weight-decimal-places#342233 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.4 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : Brave Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)  Hi,  Can I change the decimal place in weights input display in the product restrictions and dimensions. I products weight very little, but need to be displayed at 0.0018Kgs as per the actual product description from the manufacturers.  If I enter that value 0.0018kgs the system rounds it to 0.002kg  Regards, MSG")*

Hi Nicolas,

In the perfect world, grams would be great, but all the supply is in KGS.
So I am snookered on that front.

But I will do the fix, thank you so much.

Regards,
MSF

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

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

Less More

- Posts: 135
- Thank you received: 5
-
-

4 years 5 months ago [\#342234](#342234) by [markfell](/forum/user/27962-markfell "View markfell's Profile")  Replied by *[markfell](/forum/user/27962-markfell "View markfell's Profile")* on topic *[Weight Decimal Places](/forum/26-product-category-display/904523-weight-decimal-places#342234 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.4 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : Brave Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)  Hi,  Can I change the decimal place in weights input display in the product restrictions and dimensions. I products weight very little, but need to be displayed at 0.0018Kgs as per the actual product description from the manufacturers.  If I enter that value 0.0018kgs the system rounds it to 0.002kg  Regards, MSG")*

Hi Nicolas,

Have changed the database structure and now stores perfectly.
Only issue on the product page it only display weights that are &lt;![=3](/smile3.gif "=3") decimals.
Anything that has a &gt;=4 decimal place eg. 0.0002 doesnt get shown.

Is there something I need to do in a display setting somewhere?

First product weight is 0.00025, second product is 0.009

Regards,
MSF

- [ ![Screenshot2022-06-07210223.png](/forum/attachment/54965?download=1) ](/forum/attachment/54965?download=1 "...6-07210223.png") [ ](/forum/attachment/54965?download=1 "...6-07210223.png")
- [ ![Screenshot2022-06-07210247.png](/forum/attachment/54966?download=1) ](/forum/attachment/54966?download=1 "...6-07210247.png") [ ](/forum/attachment/54966?download=1 "...6-07210247.png")
- [ ![Screenshot2022-06-07210530.png](/forum/attachment/54967?download=1) ](/forum/attachment/54967?download=1 "...6-07210530.png") [ ](/forum/attachment/54967?download=1 "...6-07210530.png")
- [ ![Screenshot2022-06-07210404.png](/forum/attachment/54968?download=1) ](/forum/attachment/54968?download=1 "...6-07210404.png") [ ](/forum/attachment/54968?download=1 "...6-07210404.png")

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

4 years 5 months ago [\#342236](#342236) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Weight Decimal Places](/forum/26-product-category-display/904523-weight-decimal-places#342236 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.4 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : Brave Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)  Hi,  Can I change the decimal place in weights input display in the product restrictions and dimensions. I products weight very little, but need to be displayed at 0.0018Kgs as per the actual product description from the manufacturers.  If I enter that value 0.0018kgs the system rounds it to 0.002kg  Regards, MSG")*

Hi,

In the view file show_block_dimensions (you can edit it via the menu Display&gt;Views), you have this line: Code:

if(isset($this-&gt;element-&gt;product_weight) &amp;&amp; bccomp($this-&gt;element-&gt;product_weight,0,3)){ ?&gt;

it checks that the weight is greater than 0 to display it on the product page. The "3" in there tells the system to check up to three decimals. So you want to change that to 5.

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

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

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

Less More

- Posts: 135
- Thank you received: 5
-
-

4 years 5 months ago [\#342270](#342270) by [markfell](/forum/user/27962-markfell "View markfell's Profile")  Replied by *[markfell](/forum/user/27962-markfell "View markfell's Profile")* on topic *[Weight Decimal Places](/forum/26-product-category-display/904523-weight-decimal-places#342270 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.4 -- PHP version -- : 7.4.28 -- Browser(s) name and version -- : Brave Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)  Hi,  Can I change the decimal place in weights input display in the product restrictions and dimensions. I products weight very little, but need to be displayed at 0.0018Kgs as per the actual product description from the manufacturers.  If I enter that value 0.0018kgs the system rounds it to 0.002kg  Regards, MSG")*

Thank Nicolas,

Your coding knowledge of this system is second to none.
We would be lost without you ![:)](/media/kunena/emoticons/3.png ":)")

Regards,
MSF

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

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

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