Edit report at https://bugs.php.net/bug.php?id=53139&edit=1

 ID:               53139
 Updated by:       [email protected]
 Reported by:      kpetre at excelmicro dot com
 Summary:          floating int not displayed correctly
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          Strings related
 Operating System: win7
 PHP Version:      5.3.3

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2010-10-30 02:58:06] [email protected]

That script here outputs:

"91.65894 is this type of variable: double"

What do you get?

------------------------------------------------------------------------
[2010-10-27 19:36:36] kpetre at excelmicro dot com

<?php

$stringstart = "91.65894";  #initally i get these numbers as strings
$converttofloat = 0 + $stringstart; # i convert them to float by doing this

$vartype = gettype ($converttofloat);

echo $converttofloat . " is this type of variable: " . $vartype;

?>

------------------------------------------------------------------------
[2010-10-23 23:44:42] [email protected]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



------------------------------------------------------------------------
[2010-10-22 15:13:48] kpetre at excelmicro dot com

Description:
------------
I am developing a tool which parses header information etc. were using 5.3.1 
and cant really upgrade at the snap of a finger due to management limitations. 
One line in the message is $levels.  This contains a bunch of floating point 
numbers which i will need to compare to other floating point numbers.  I have a 
table where this floating int is 'echoed'.  When it is echo'd, numbers to the 
left of the decimal appear as a symbol character. Once the page is refreshed, 
the numbers to the left of the decimal are displayed correctly. (real example 
'?.15998') as soon as its refreshed, 20.15998 is shown as expected.

I thought if i changed the $scorefinal back to a string it would resolve but it 
does the same thing.  Any thoughts?

Test script:
---------------
echo $levels;   //$levels= (S:20.15998/99.90000 CV:99.9000 FC:95.5390 
LC:93.6803 R:95.9108 P:95.9108 M:97.0282 C:60.2565 )..



$scorefinal = strstr($levels,"S:");
$scorefinal = strstr($scorefinal,"/",true);
$scorefinal = substr($scorefinal,2);    
//echo $scorefinal;                        //this now is a string and is 
20.15998
$scorefinal = 0 + $scorefinal;             //convert to float
$scorefinal2 = "$scorefinal";              //20.15998 is now a string again

Expected result:
----------------
I expect to see the full floating int every-time the page is called.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=53139&edit=1

Reply via email to