Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to stop round() displaying result as exponential

    A result such as 38,000,000 is output as 3.8E+7. How can I make it output as 38,000,000. Thanks a lot

  • #2
    New Coder
    Join Date
    Mar 2008
    Location
    Somerset, England
    Posts
    93
    Thanks
    0
    Thanked 10 Times in 10 Posts
    This works

    PHP Code:
    <?php
    $number 
    38000000.4
    echo number_format(round($number), 0'.'',');
    ?>
    If you don't actually want the commas as seperators then replace ',' with ''
    Last edited by RMcLeod; 05-13-2008 at 03:40 PM.

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Fantastic! Thanks very much.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •