note 5832 modified in function.round by danbrown

From: Date: Sun, 17 May 2009 16:27:56 +0000
Subject: note 5832 modified in function.round by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-154831@lists.php.net to get a copy of this message
If you'd only want to round for displaying variables (not for calculating on the rounded result) then you should use printf with the float: <?php printf ("%6.2f",3.39532); ?> This returns: 3.40 . --was-- If you'd only want to round for displaying variables (not for calculating on the rounded result) then you should use printf with the float: printf ("%6.2f",3.39532); This returns: 3.40 . http://php.net/manual/en/function.round.php

« previous php.notes (#154831) next »