CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Round numbers?

  1. #1
    Join Date
    Sep 2005
    Posts
    73

    Round numbers?

    Hello, I have a list of numbers that can be in format like:

    Code:
    8.8458e-119    
    1.06542e-52
    2.68e-36
    2.91405e-35
    0.0190644
    0.0205511
    0.004
    Is there something you can suggest me that I use to have some more "elegance" appearance, i.e:
    Code:
    8.84e-119    
    1.06e-52
    2.68e-36
    2.91e-35
    0.019
    0.02
    0.004
    ? Note that I have all these number formats and I want to use a command that could apply to all of them.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Round numbers?

    You haven't mentioned what server-side language you are using. If it is PHP, have you tried using sprintf()?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured