[PHP] formating numbers to two decimal points - money - best ways

2001-07-18 Thread Tim Olsen

Anyone have functions for formatting numbers being multiplied by variables 
and whatnot to two decimal points - rounded up? As for displaying total 
cost, etc?
_
Get your FREE download of MSN Explorer at http://explorer.msn.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]




Re: [PHP] formating numbers to two decimal points - money - best ways

2001-07-18 Thread David Robley

On Wed, 18 Jul 2001 17:21, Tim Olsen wrote:
 Anyone have functions for formatting numbers being multiplied by
 variables and whatnot to two decimal points - rounded up? As for
 displaying total cost, etc?

PHP has :-) have a look at the mathematical functions.

http://www.php.net/manual/en/ref.math.php

Round is probably the one you want.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   If a program is useless, it must be documented.

-- 
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]




RE: [PHP] formating numbers to two decimal points - money - best ways

2001-07-18 Thread Adrian Ciutureanu

?
$c = 12.3456;
echo number_format($c, 2);
?

http://php.net/number_format


 -Original Message-
 From: Tim Olsen [mailto:[EMAIL PROTECTED]]
 Sent: 18 iulie 2001 10:52
 To: [EMAIL PROTECTED]
 Subject: [PHP] formating numbers to two decimal points - money - best
 ways
 
 
 Anyone have functions for formatting numbers being multiplied 
 by variables 
 and whatnot to two decimal points - rounded up? As for 
 displaying total 
 cost, etc?

--
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]