You are here: PHP5 sprintf() function borken « PHP « IT news, forums, messages
PHP5 sprintf() function borken

Posted by Thomas Munz on 10/04/37 11:05

Today i think i found an bu in the PHP5 version 5.0.3 ( allready exits also in
the version 5.0.2 , i try this version also ).

When tryo one of this scripts:

$i_test = "0.085007667542";
$tm_total = sprintf('%.2f', $i_test);
echo $tm_total;

$i_test = 0.085007667542;
$tm_total = sprintf('%.2f', $i_test);
echo $tm_total;

$i_test = "0.085007667542";
$tm_total = sprintf('%.2f', floatval($i_test));
echo $tm_total;


i always get an other result. Some time it get a result like that:

"-26815615859885220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.00"

my friend try it also and have the same problems...

is that a bug in php5?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация