João Cândido de Souza Neto wrote:
If you look at carefuly, you´ll see that i´ve two problems in the same
function.
1 - This function add blank spaces at the beginning of the string.
2 - This function rounds the $var value and it can causes meny troubles.
Ok, I've already checked that number_format will not output spaces based
on the calls you gave. Here's that script since it seems you don't
believe me - try it yourself...
<?php
// This tests whether number_format is adding spaces
print "'".number_format("3000",2,",",".")."'\n";
print "'".number_format("300",2,",",".")."'\n";
?>
As for the rounding thing, it does appear that number_format will round
the number before displaying it. To avoid this you'll need to manipulate
the number using the string functions.
-Stut
PS. Please do not just reply to me directly.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php