FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » counting the digits in a number, exponential format problem
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: counting the digits in a number, exponential format problem [message #171007 is a reply to message #171003] Tue, 14 December 2010 21:50 Go to previous messageGo to previous message
mhandersen is currently offline  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.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: width measurements?
Next Topic: cheap, discount nike air max shoes, paypal payment, free shipping
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 22:21:19 GMT 2024

Total time taken to generate the page: 0.04719 seconds