SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stripping decimals?

    I need to make a number no longer than 2 decimals long

    i.e

    this----> 102.23589

    To-----> 102.24

    Any ideas

    thanks in advance
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  2. #2
    SitePoint Addict
    Join Date
    Apr 2001
    Location
    Michigan
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
     number_format($number2
    OR

    PHP Code:
    round($number2
    Either one should get you what you want.

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That worked wonders, thanks for the help
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"


Bookmarks

Posting Permissions

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