Jump to content

Archived

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

simonp

Dealing with money

Recommended Posts

Hi,

What would be the best way to deal with rounding money to two decimal places.

At the moment I'm getting 14.1 and I want 14.10

Any ideas greatfully appreciated.

Simon

Share this post


Link to post
Share on other sites
This should do it...
[code]$number = number_format($number,2);[/code]

Share this post


Link to post
Share on other sites
[!--quoteo(post=373998:date=May 15 2006, 09:15 AM:name=SemiApocalyptic)--][div class=\'quotetop\']QUOTE(SemiApocalyptic @ May 15 2006, 09:15 AM) [snapback]373998[/snapback][/div][div class=\'quotemain\'][!--quotec--]
This should do it...
[code]$number = number_format($number,2);[/code]
[/quote]

Thanks SemiApocalyptic - that was easy :)

Simon

Share this post


Link to post
Share on other sites

×

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.