View Single Post
Old 12-11-2007, 01:46 AM   #10 (permalink)
Haris
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
Regarding echo sprintf, what's that all about? Also, there is no need in this case for double quotes around the formatting string. I'm sure this isn't the first time I've seen echo sprintf posted up here, so every time I see it, I'll keep nagging!

php Code:
foreach (range(1, 200) as $iInteger)
{
    printf('%02d', $iInteger);
}
The PHP document inspired me to use the echo.

Quote:
Example#9 sprintf(): scientific notation
<?php
$number = 362525200;

echo sprintf("%.3e", $number); // outputs 3.625e+8
?>
http://www.php.net/sprintf, start nagging them.
__________________
Necessity is the mother of invention.

My blog
Haris is offline  
Reply With Quote