note 712 modified in sprintf by ronabop
| From: | ronabop@php.net | Date: | Wed, 13 Dec 2000 06:28:56 +0000 |
| Subject: | note 712 modified in sprintf by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8690@lists.php.net to get a copy of this message | ||
Hey folks, don't forget to prefix a precision specifier with a period '.'!
Thus, to print a floating point number,
say $x, with two digits after the decimal point you would write:
printf( "%.2f", $x );
http://www.php.net/manual/function.sprintf.php