[PHP][PHP] Money Decimals

2003-02-19 Thread Dennis Cole
I am writing a script that will take amount out of a database then display
them on the page. But, some of these are like 46.0 or 46 or 46.005,
and they all need to look like 46.00. Is there an easy way to do this.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP][PHP] Money Decimals

2003-02-19 Thread Richard Whitney
Do you ever want to show more then .00 in the decimals place?
If not, strip everything off of the number after the decimal including the decimal.
then format the number on retrieval by using number_format($number,2);

HTH

RVW

Quoting Dennis Cole [EMAIL PROTECTED]:

### I am writing a script that will take amount out of a database then
### display
### them on the page. But, some of these are like 46.0 or 46 or 46.005,
### and they all need to look like 46.00. Is there an easy way to do this.
### 
### 
### -- 
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
### 
### 


-- 
Richard Whitney   *
Transcend Development
Producing the next phase of your internet presence.
[EMAIL PROTECTED]   *
http://xend.net*
602-971-2791
  * *   *
*  *  *__**
 _/  \___  *
 *  /   *\**
  */ * *  \
**/\_ |\
 /   \_  /  \
/  \/\
   /  \ 
  /\
 /  \


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP][PHP] Money Decimals

2003-02-19 Thread Justin French
Did you even bother to look on the site?

To prove a point, I did a seach for the word number on PHP, and found this
result within SECONDS:

http://www.php.net/manual/en/function.number-format.php


Justin French





on 20/02/03 9:54 AM, Dennis Cole ([EMAIL PROTECTED]) wrote:

 I am writing a script that will take amount out of a database then display
 them on the page. But, some of these are like 46.0 or 46 or 46.005,
 and they all need to look like 46.00. Is there an easy way to do this.
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php