"Duffy, Scott E" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Are printf and number_format supposed to round?
echo ($hcount-$lcount)/$hilow." ";
echo number_format(($hcount-$lcount)/$hilow,2,'.','');
0.208333 0.21
0.145833 0.15
0.17 0.17
0.0833
sprintf()
http://php.net/manual/en/function.sprintf.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
figured that out as well
You need to put the number_format($number,2) afterwards
Thanks to both you!
"Ron Allen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am looking at how to format output
>
> Here is what I have. There is a simple currency convers
Figured out why it wasn't working, but I need to be able to display the 2
decimals afterwards
"Ron Allen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am looking at how to format output
>
> Here is what I have. There is a simple currency conversion that I
This is what I have and it is not working
$converted1 =round($usdamount * $convamount, 2);
$converted = number_format($converted1);
//echo "$amount * $convamount = $converted";
echo "You should receive$nbsp $converted $currency";
"Ron Allen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]
Use number_format() to put a comma between the thousands
$foo = 123456789;
print number_format($foo); //will print 123,456,789
Ron Allen wrote:
> I am looking at how to format output
>
> Here is what I have. There is a simple currency conversion that I do and
> the output is just a string of nu
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
> I am looking at how to format output
>
> Here is what I have. There is a simple currency conversion that I do and
> the output is just a string of numbers
> I would like it so that it puts a comma for every 3 spaces...Any
> clues..
Thank Richard.
So far, I just punted. My site runs on a dedicated box and doesn't
have to service a lot of users so I just wrote a one line C program
to print a single value using a specified format (default is %.4e)
and use exec() to call it.
printe [format] value
Here's how I encapsula
You could roll your own...
% and (int) / and round() are all you need.
--
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
-
9 matches
Mail list logo