Dealing with BIG numbers - how to avoid E+ signs ?

Discussion in 'PHP' started by ActiveFrost, Mar 15, 2009.

  1. #1
    What I want to say is - numbers are BIG and it results in something similar to 1.00971009752E+13 !

    How to display full number without these 1.00E+24 signs ? ( don't ask why I need it - I simply need it :D )

    Thanks for your help,
    ActiveFrost.
     
    ActiveFrost, Mar 15, 2009 IP
  2. young coder

    young coder Peon

    Messages:
    302
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <?php 
    
    $number1 = 10097100975053 ;
    $number2 = 10097100975053541024129;
    $number3 = $number1 + $number2 ;
    
    echo number_format($number3, 2, '.', '');
    
    ?>
    PHP:
    Result
    10097100985150642061312.00
     
    young coder, Mar 15, 2009 IP
    ActiveFrost likes this.
  3. ActiveFrost

    ActiveFrost Notable Member

    Messages:
    2,072
    Likes Received:
    63
    Best Answers:
    3
    Trophy Points:
    245
    #3
    Thanks for the solution ( never had a chance to deal with number formatting ) - will check it a bit deeper ! +rep
     
    ActiveFrost, Mar 15, 2009 IP