note 46405 added to function.sprintf
| From: | phpmanual at oderwat dot de | Date: | Sat, 09 Oct 2004 23:11:33 +0000 |
| Subject: | note 46405 added to function.sprintf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78253@lists.php.net to get a copy of this message | ||
I just stumbled over a problem:
sprintf("%06.2f",2.20)
does get "000002.20" on my linux 4.3.6 php
and it gets "2.20" on my windows 5.0.2 php
"decimal" just works fine!
I think that is dangerous behaviour! As many database related stuff works with fixed fields. In my
case a "ksort()" was going wrong for that reason!
----
Manual Page -- http://www.php.net/manual/en/function.sprintf.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46405
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46405&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46405&report=yes
Search -- http://master.php.net/manage/user-notes.php