try $total=((0.416 / $time) * 60) * 60); $output=number_format($total,2,'.',','); / / uses comma separators between thousands and a decimal point between the units and tenths. or $output=number_format(((0.416 / $time) * 60) * 60),2,'.',','); / / php is usually forgiving on combined operations.
number_format() truncates the number so if you have 1.209 it will lop of the last number resulting in 1.20. if you want a rounded number use round(). both commands are in the online manual. hope this helps. Hugh ----- Original Message ----- From: Andrew <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 10, 2002 4:05 PM Subject: [PHP] New to list > Hello to you all! > I am new to this list and I have a question that maybe someone can help with > > In a script I am working on I have a math's equation : > > ((0.416 / $time) * 60) * 60) > > this out but a figure at goes to a about 10 decimal places I only want 2 > decimal places and just can not figure out how to do this > > Any ideas would be great > > > Thanks > > Andrew > Web Harper Graphics > www.webharpergraphics.com > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]