note 78886 deleted from function.sprintf by nlopess
| From: | nlopess@php.net | Date: | Wed, 31 Oct 2007 21:22:15 +0000 |
| Subject: | note 78886 deleted from function.sprintf by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-131881@lists.php.net to get a copy of this message | ||
Note Submitter: teddy at chemicalfusion dot net
----
In response to sitefr at gmail dot com:
Would simply dividing by 10 not work?
<?php
$numbers = array(5, 25, 37, 50);
foreach($numbers as $num)
printf("%1.1f\n", $num/10);
// Should output
// 0.5
// 2.5
// 3.7
// 5.0