Number formatting
| From: | Scott | Date: | Thu, 06 Jun 2002 13:56:47 +0000 |
| Subject: | Number formatting | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-100931@lists.php.net to get a copy of this message | ||
Hi gang-
I am trying to format a number coming from a csv file that I am importing
then sending to a database. Being the wonderful program that Excel is
there is a column that contains a number that only has a decmimal if there
is a value. So 3.05% will display, 3% will display as 3. It is throwing
my calculations off, I have tried using number format like this:
$aprTemp = number_format($apr, 2); which in the case of 3.05 will return
305.00 and 300.00 for 3%. Anyone have a snippet to test and display
properly so that 3% would be 3.00, etc.
Thanks,
-Scott