RE: [PHP] money_format undefined.
| From: | Dan Joseph | Date: | Tue, 08 Apr 2003 20:23:33 +0000 |
| Subject: | RE: [PHP] money_format undefined. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142955@lists.php.net to get a copy of this message | ||
I use a function I made...
function money ($m, $p) {
if ($p == 1) { $dollar = "$"; }
return $dollar . sprintf("%01.2f", $m * 0.005);
}
Seems to work just fine. just do a "money($var, 1)" or money($var, 0)..
1 will turn on the $.
-Dan Joseph
-----Original Message-----
From: Kevin Stone [mailto:kevin@helpelf.com]
Sent: Tuesday, April 08, 2003 2:32 PM
To: php-general@lists.php.net
Subject: Fw: [PHP] money_format undefined.
----- Original Message -----
From: "Rob Adams" <rob_adams@hotmail.com>
To: <php-general@lists.php.net>
Sent: Tuesday, April 08, 2003 12:22 PM
Subject: [PHP] money_format undefined.
> I'm running PHP 4.3.1 as a module in Apache 2. When I try to use the
> money_format() function, it says it is undefined, but the docs say: (PHP 4
> >= 4.3.0). I tried doing a search for money_format on this list, but
> nothing returned. I've seen other people mention searching the archives.
> How do you do that? Anyone know why this would be undefined? Thanks.
>
> -- Rob
I'm afraid I don't have a direct solution for you.. frankly I didn't even
know we had a "money_format" function until I read this post. But currency
values can be handed in any one of a dozen different ways. Look up printf()
or number_format() in the manual on www.php.net Search the list archives on
www.php.net or just use Google Groups since every post to the email list is
echoed to the newsgroup and vice-versa.
HTH,
Kevin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php