• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3219
  • Last Modified:

convert exponential numbers to actual numbers

Hi -

I want to convert a value (which may or may not) be in exponential format to an actual value - e.g. I want 10,000,000,000 rather than the exponential equivalent.  Can anyone suggest code that will convert the exponential value to an actual value?

Thanks!

Pete
0
shafer23
Asked:
shafer23
  • 2
  • 2
1 Solution
 
Hube02Commented:
what format is that exponential number in? is it a string? can you supply some example of that needs to be converted?
0
 
marchentCommented:
using php number_format()
$number = 10e10;
print number_format($number);

Open in new window

0
 
shafer23Author Commented:
Hi marchent - that works - thanks!  

The number could have decimals, so I am using the following formula:
$value = number_format  ($value, 20, '.', '')

My only question is that I am uncertain as to how many decimal places there may be, so I am just using an arbitrarily high number, e.g. 20.  Is there anything that I am overlooking - i.e. is there another way to handle a variable number of decimal places.

If not, that is fine - but I just thought that I would check.  Thanks again!

Pete



0
 
marchentCommented:
yeah, your 20 is for number of decimal places to handle.  I don't know any other way to do this.
0
 
shafer23Author Commented:
Thanks for your help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now