How to edit NUMBER FORMAT for weight? Opencart 3.0.2.0
Posted: Wed Oct 03, 2018 3:15 am
Hello,
I've added the weight for each product in ounces to the product page. I'm SO close! Can anyone tell me how to change the number format to 2? I've tried a variety of things but it's not working so I'm admitting defeat and asking for help
Added to catalog/controller/product/product.php
Added to product/product in theme editor
Resulted in showing 4.600000 oz. (or weight for that product) which is exactly what I want, just with fewer decimal points.
Thanks! Tina
I've added the weight for each product in ounces to the product page. I'm SO close! Can anyone tell me how to change the number format to 2? I've tried a variety of things but it's not working so I'm admitting defeat and asking for help
Added
Code: Select all
$data['weight'] = $product_info['weight'];
Added
Code: Select all
<li>{{ weight }} oz.</li>
Resulted in showing 4.600000 oz. (or weight for that product) which is exactly what I want, just with fewer decimal points.
Thanks! Tina