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
    New Coder thindrakhya's Avatar
    Join Date
    Jun 2007
    Posts
    90
    Thanks
    8
    Thanked 0 Times in 0 Posts

    decimal number dispaly

    hi friends ,


    i have one table filed cost = decimal(20,4) set in dtatabse table

    Now when i display cost the result comes as 14.0000 now what i want is
    when cost is integer like 14.0000 the display should be 14 and if 14.5000 it should show 14.50

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Have you searched the PHP manual?

    I typed in "number format" in the search box and lo and behold, went straight to the number_format() page.

    That should always be the first step when you have a question on how to do something in PHP.


  •  

    Posting Permissions

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