note 32230 added to function.round
| From: | Justin at rack1 dot php dot net | Date: | Wed, 21 May 2003 01:20:26 +0000 |
| Subject: | note 32230 added to function.round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-48706@lists.php.net to get a copy of this message | ||
I need a way to display a nice looking number. Everything I try messes it up in some different way.
Say I have:
$num = 123456789123456789;
format_number($num);
//123,456,789,123,456,800 is the output
and
$num = 123456789123456789;
ceil(number_format($num));
//123 is the output
I need a way that it will read
123,456,789,123,456,789
but if it is a decimal I need it to be shown like:
123,456.789123456789
without extra zeros or anything.
This has to work for just about any number except for scientific notation. And the data is inserted
without comma's.
Replies would be GREATLY appreciated!
----
Manual Page -- http://www.php.net/manual/en/function.round.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32230
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32230&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32230&report=yes