On Sun, Apr 26, 2009 at 18:15, Gary wrote:
> Sorry for the delay in response. I was able to figure the number_format()
> function out.
>
> Thanks for all your responses.
Since you're working specifically with money as described in your
example, Gary, you could also check out money_format()[1
Sorry for the delay in response. I was able to figure the number_format()
function out.
Thanks for all your responses.
Gary
""Gary"" wrote in message
news:21.39.63007.75193...@pb1.pair.com...
>I cant seem to get this to work for me. I want the number to be formated
>to money (us, 2 decimal
Gary wrote:
I cant seem to get this to work for me. I want the number to be formated to
money (us, 2 decimal points).
/**
* returns 4.3 as $4.30 (formats us dollars)
*
* @param $amount
* @return string
*/
function us_dollar_format( $amount )
{
return ( '$' . number_format($amount,
if your datas are stored in a DB you should specify the precision of the
float in the table : float(8,2)
> Anyone have functions for formatting numbers being multiplied by variables
> and whatnot to two decimal points - rounded up? As for displaying total
> cost, etc?
> __
You mean like PHP's number_format function http://php.net/number_format :-)
--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
--
5 matches
Mail list logo