Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

rounding calculated values to 2 decimal places


Guest

Recommended Posts

Hi, I have a piece of code which works out the discounted price of items... it looks like this:

<?php
 if (MODULE_ORDER_TOTAL_INSTALLED) {
   $ot_qty_discount->process();
   echo $ot_qty_discount->get_order_total();

 }
?>

 

What can I add to this code so that it only shows values with 2 decimal places eg.

$10.95 instead of $10.9511

Link to comment
Share on other sites

don't worry about this one... I just changed

 

echo $ot_qty_discount->get_order_total();

 

to

 

echo $currencies->format($ot_qty_discount->get_order_total());

 

and it works fine now

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...