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 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2009
    Location
    UK
    Posts
    90
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Simple Question: How do add a decimal to a number. 300 to 3.00

    How do add a decimal to a number so that 300 becomes 3.00

    i can make it 300.00 but just cant find a way to make it 3.00

    Thanks In-advance

    Jenna

  • #2
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    John

  • #3
    New Coder
    Join Date
    Oct 2009
    Location
    UK
    Posts
    90
    Thanks
    14
    Thanked 0 Times in 0 Posts
    I've tried that but i cannot format the number 300 to 3.00

    thanks
    jenna

  • #4
    Senior Coder
    Join Date
    Apr 2007
    Location
    Quakertown PA USA
    Posts
    1,028
    Thanks
    1
    Thanked 125 Times in 123 Posts
    Apologies, I read your question wrong.

    PHP Code:
    $number 300/100;
    echo 
    number_format($number2); // echos 3.00 
    John

  • Users who have thanked PappaJohn for this post:

    mobimad (04-03-2010)


  •  

    Posting Permissions

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