Jump to content

[Solved] about decimal places and rounding in email template


Recommended Posts

Hi all,

 

Hoping someone good at php can help me here...

 

I have created a tag called [subtotal_price], which is the [purchase_supplier_price] tag multiplied by [product_quantity] tag. I want to display this in an email template that is sent to suppliers. However, the tag displays no decimal places if it is a whole number. ie it displays $10 instead of $10.00. I really want prices to be consistent and have 2 decimal places.

 

I have created the [subtotal_price] tag as follows in a php file:

 

$product['subtotal_price']=$product['purchase_supplier_price']*$product['product_quantity'];
 

I have tried using number_format and echo round, but my attempts only lead to a white screen in the back-office.

 

Can anyone show me how to add a minimum of 2 decimal places to the [subtotal_price] tag?

 

Thanks for any thoughts!

Edited by mowax (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...