RE: [PHP] Money format

From: Date: Tue, 20 Jul 2004 18:20:17 +0000
Subject: RE: [PHP] Money format
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-191203@lists.php.net to get a copy of this message
Hi, From php.net/sprintf: <?php $money1 = 68.75; $money2 = 54.35; $money = $money1 + $money2; // echo $money will output "123.1"; $formatted = sprintf("%01.2f", $money); // echo $formatted will output "123.10" ?> I think you'd have to format the . and , a bit differently, but that should be a start. -Dan Joseph > -----Original Message----- > From: Lukáš Moravec - PTV Servis [mailto:moravec@ptv.netwave.cz] > Sent: Tuesday, July 20, 2004 2:10 PM > To: php-general@lists.php.net > Subject: [PHP] Money format > > Hi to all, > is there any function wich can format a "double" or "string" into > "money > format".for example: 1526789,99 to 1.526.789,99 or something like that.? > Regards Lukas

« previous php.general (#191203) next »