Where should I edit in order to setup product weight with 2 decimals. Now the weight it showed in format as: 13.000 kilos. Those 3 zeros are useless.
2 Answers
It depends on the theme you are using how and where the weight is outputted. I would advice you to turn on template hints on the front end to figure out where to edit the output of the weight.
Magento works by default with 4 decimals for weight (and price) and I would advice against editing the back end to accept just 2.
Another option would be to make sure under Attributes
that the weight attribute is not displayed in product listing and create a second attribute called weight_display
, type text, for example that is used on the frontend to show the weight of the product. This way Magento can use it's internal 4 decimal weight attribute and on the front end you can use your own attribute
In database, weight attribute have backend_type set to decimal.
To change the decimal precision of attributes that have a backend_type set to decimal,
You have to change the type of value in this table :
catalog_product_entity_decimal
If you have not change yet, you should see :
decimal(12,4)
In your case, you have to replace with
decimal(12,2)
Then weight will be display with 2 decimals : (13.00 kilos) in admin, and in frontend