Jump to content

[SOLVED] Format Value To 2 Decimal Places


stevesimo

Recommended Posts

Hi, when I output my double number which is a currency value, instead of getting £1.50 I am getting £1.5

 

Here is my code:

 

echo '<td width="25%">£'.$row->IPT.'</td></tr>';

 

My question is how do I format the output so that it appears as £1.50 ie. 2 decimal places

 

Many thanks

 

Steve (Blackpool)

Link to comment
https://forums.phpfreaks.com/topic/43995-solved-format-value-to-2-decimal-places/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.