RE: [PHP] Problem with round

From: Date: Tue, 04 Dec 2001 00:08:57 +0000
Subject: RE: [PHP] Problem with round
Groups: php.general 
Request: Send a blank email to php-general+get-76435@lists.php.net to get a copy of this message
to print two decimal points always, use : printf("%.2f",$value); round() just rounds the number and doesn't store extra zeros. -----Original Message----- From: Diego Pérez [mailto:webzitos@terra.es] Sent: Tuesday, December 04, 2001 11:06 AM To: php-general@lists.php.net Subject: [PHP] Problem with round Hi to all: I can't understand, but i have a simple problem with round. I use the function round($value,2) to round a number with 2 decimals. But when i put the result in the screen, if $value don't have more or equal than 2 decimal numbers, the result only have one o none decimals. I do some examples, but not work correctly. Can someone help me. Thanks. Best Regards, Diego

« previous php.general (#76435) next »