#21658 [Opn->Fbk]: Strange sprintf behaviour
| From: | iliaa@php.net | Date: | Wed, 15 Jan 2003 18:35:32 +0000 |
| Subject: | #21658 [Opn->Fbk]: Strange sprintf behaviour | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-30148@lists.php.net to get a copy of this message | ||
ID: 21658
Updated by: iliaa@php.net
Reported By: andrea@euronia.it
-Status: Open
+Status: Feedback
Bug Type: *General Issues
Operating System: Gentoo Linux
PHP Version: 4.3.0
New Comment:
Works fine here to.
Do you have any locales exported?
Previous Comments:
------------------------------------------------------------------------
[2003-01-15 09:35:20] sniper@php.net
It works fine here (glibc 2.1.3)
------------------------------------------------------------------------
[2003-01-15 08:06:22] andrea@euronia.it
mod_php 4.3.0 produce a strange sprintf behaviour
for($t=0;$t<10;$t++) {
$r=(float) rand(0,10000)/3;
echo $r." -> ".sprintf('%.3f',$r)."\n";
}
will produce ...
1975.33333333 -> ç.000
508.333333333 -> ,.000
2483.66666667 -> ã.000
61.6666666667 -> m.000
2514.66666667 -> I00.000
2499.66666667 -> *0.000
1957.33333333 -> ü0000.000
3167.33333333 -> 0.é00
655.666666667 -> 600.000
3321.66666667 -> ).000
2256.33333333 -> 0.S00
383.666666667 -> 0.,00
1565.33333333 -> M.000
I suppose there's something wrong with glibc 2.3.1
Any ideas?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21658&edit=1