note 16004 added to function.printf
| From: | deekayen at hotmail dot com | Date: | Thu, 11 Oct 2001 21:54:11 +0000 |
| Subject: | note 16004 added to function.printf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18843@lists.php.net to get a copy of this message | ||
You can use this function to format the decimal places in a number:
$num = 2.12;
printf("%.1f",$num);
prints:
2.1
see also: number_format()
--
http://www.php.net/manual/en/function.printf.php
http://master.php.net/manage/user-notes.php?action=edit+16004
http://master.php.net/manage/user-notes.php?action=delete+16004
http://master.php.net/manage/user-notes.php?action=reject+16004