#21648 [Fbk->Csd]: number_format() output error

From: Date: Wed, 15 Jan 2003 15:27:10 +0000
Subject: #21648 [Fbk->Csd]: number_format() output error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-30124@lists.php.net to get a copy of this message
ID: 21648 Updated by: sniper@php.net Reported By: bubak@cpan.cz -Status: Feedback +Status: Closed Bug Type: *Math Functions Operating System: RedHat 7.3 PHP Version: 4.3.0 New Comment: Closing then. Previous Comments: ------------------------------------------------------------------------ [2003-01-15 06:04:13] bubak@cpan.cz I used file "math.c" from version of PHP 4.3.1-dev before change on 9.1.2003. It seems to work well ------------------------------------------------------------------------ [2003-01-15 03:57:34] sniper@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2003-01-15 01:58:50] bubak@cpan.cz There is problem with output from function number_format() I have compiled PHP 4.3.0 as Apache module. print number_format($number,2,"."," "); if $number is in range 100000 - 999999 or 100000000 - 999999999, output has random character at the begining. example: <? $number=850000000.90; $number_f=number_format($number,2,"."," "); for ($i=0;$i<strlen($number_f);$i++) { print ord($number_f[$i])." --> ".$number_f[$i]."<br />"; } print $number_f; ?> produced: 114 --> r 56 --> 8 53 --> 5 48 --> 0 32 --> 48 --> 0 48 --> 0 48 --> 0 32 --> 48 --> 0 48 --> 0 48 --> 0 46 --> . 57 --> 9 48 --> 0 r850 000 000.90 next run of script add this at the beginning: 72 --> H Thank you for your help. Regards Milan ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21648&edit=1

« previous php.bugs (#30124) next »