Decimal places in displaying amount

Hi there,

I have a database with table column called amount1

if amount1 value was £5,50
it only displays £5,5 how do i get it to display 2 decimal places.

My code at moment

echo “Total Expenses &nbsp &pound” . $row[‘SUM(AMOUNT1)’]. “

”;

Thanks

You want number_format:

echo "Total Expenses &pound" . number_format($row["SUM(AMOUNT1)"], 2);

thank you so much for the advice

Sponsor our Newsletter | Privacy Policy | Terms of Service