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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Posts
    712
    Thanks
    165
    Thanked 0 Times in 0 Posts

    Code for adding decimal places code

    Good day!

    I want to know where I can put this code :
    PHP Code:
     number_format($num), 2
    I have this code:
    PHP Code:
    echo mysql_result ($result,$ctr,"inputqty"); 
    I want the output if this code is in 2 decimal places for example the output in this code is: 1.9856211 I want to become is like this 1.99

    I hope somebody can help me...thank you..

  • #2
    Regular Coder poyzn's Avatar
    Join Date
    Nov 2010
    Posts
    266
    Thanks
    2
    Thanked 61 Times in 61 Posts
    try this
    PHP Code:
    echo number_format(mysql_result($result,$ctr,"inputqty"), 2'.'''); 


  •  

    Posting Permissions

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