PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
kevin7
Forum Commoner
Posts: 96 Joined: Fri May 21, 2004 6:54 am
Post
by kevin7 » Thu Jun 24, 2004 5:11 am
how to make a value... for example 130.328... to be rounded to 130.33..
tq...
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Jun 24, 2004 5:23 am
[php_man]round[/php_man]($num, 2);
kevin7
Forum Commoner
Posts: 96 Joined: Fri May 21, 2004 6:54 am
Post
by kevin7 » Thu Jun 24, 2004 5:42 am
hmm.... yes... it work...
if i wanna to display 128.8 to 128.80?
really appreaciated!
patrikG
DevNet Master
Posts: 4235 Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK
Post
by patrikG » Thu Jun 24, 2004 5:51 am
if you'd need it for display only, have a look at [php_man]sprintf[/php_man]
kevin7
Forum Commoner
Posts: 96 Joined: Fri May 21, 2004 6:54 am
Post
by kevin7 » Thu Jun 24, 2004 7:17 am
ooo... that was C programming~~~
i neva thought it was such useful in PHP too...!
tq anyway~