[PHP] Re: printf and number_format rounding

2006-05-03 Thread Dan Baker
"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

[PHP] Re: printf() in a variable, or alternative to printf()

2005-05-27 Thread Jason Barnett
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

[PHP] Re: printf

2002-04-10 Thread Ron Allen
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

[PHP] Re: printf

2002-04-10 Thread Ron Allen
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

[PHP] Re: printf

2002-04-10 Thread Ron Allen
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]

[PHP] Re: printf

2002-04-10 Thread Steve Fitzgerald
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

[PHP] Re: printf

2002-04-10 Thread David Robley
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..

[PHP] Re: printf scientific notation?

2001-10-05 Thread Bill Rausch
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

[PHP] Re: printf scientific notation?

2001-10-04 Thread Richard Lynch
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 -