#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    London
    Posts
    46
    Rep Power
    14
    Right now I have a number ie: 80.5

    I need to change this to: 80.50

    Using printf I would use:
    printf("%.2f", 80.5);

    But I don't want to print it out.

    Thanks to anyone with any suggestions.

    Kelvin
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    14
    use

    $var = sprintf("%.2f", 80.5);

    Now $var holds your value
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    London
    Posts
    46
    Rep Power
    14
    Thanks.

    Thanks alot.

Similar Threads

  1. Text box Number formatting
    By Bijoos in forum Visual Basic Programming
    Replies: 6
    Last Post: February 17th, 2004, 09:19 PM
  2. array explode ( string separator, string string [, int limit])
    By beemee_freeserv in forum HTML Programming
    Replies: 4
    Last Post: February 5th, 2004, 10:56 AM
  3. mgetty+sendfax on RH9
    By ayrin in forum Linux Help
    Replies: 0
    Last Post: January 31st, 2004, 02:11 AM
  4. formatting a phone number
    By aliaga61 in forum ASP Programming
    Replies: 1
    Last Post: December 31st, 2003, 03:21 AM
  5. adding string after number of bytes
    By king_killa in forum PHP Development
    Replies: 2
    Last Post: December 21st, 2003, 12:00 AM

IMN logo majestic logo threadwatch logo seochat tools logo