For changing the 0.00000000 to 0 for example, you can go to your database phpMyADMIN ; go to table 'product' ->structure > find 'lenght' , 'width' and 'height' and change the decimal values from 15,8 to 15,0 ' .emptyT wrote:Re: Display Product Dimensions Field on category.tpl
[background=]by LukeClifton » Thu May 17, 2012 11:43 am
Dan,
You can use the PHP Round function to format the dimension variables that are being outputted.
Add the following code to your product view file:
CODE: SELECT ALL
<?php echo round($length, 2); ?>
<?php echo $text_by; ?>
<?php echo round($width, 2); ?>
<?php echo $text_by; ?>
<?php echo round($height, 2); ?>
More info on this function here:
http://www.php.net/manual/en/function.round.php[/background]
Where exactly does this code go?
Can someone tell me which file and where in the file please.
Everything else works great but I have 8 zeros after the decimal point
If you preffer to have the numbers like 0,00 , you have to change the decimal to 15.2