Re: counting the digits in a number, exponential format problem [message #171007 is a reply to message #171003] |
Tue, 14 December 2010 21:50 |
mhandersen
Messages: 5 Registered: December 2010
Karma:
|
Junior Member |
|
|
@ED: thanks for the reply. at least that helps me understand whats
going on.
i guess what i really want now then is a way to turn off exponential
formatting. i don't like that:
echo floatval(3E-5); // '3.0E-5'
echo strval(3E-5); // '3.0E-5'
echo floatval(0.00003); // '3.0E-5'
echo strval(0.00003); // '3.0E-5'
the strval() output is understandable (now). i could even deal with
the output of floatval(3E-5), but why does it feel the need to convert
to exponential formatting with floatval(0.00003)? 3.0E-5 is much more
'sting like' than 0.00003 is to me, so why would you convert it to the
string form if preforming a numeric operation on the value?
i know that i can can display it however i want with something like
printf("%f",3E-5); but that doesn't help me "count digits" as my
original question asked...
thanks everyone for your input.
|
|
|