View Full Version : decimal number dispaly

11-01-2007, 04:42 AM
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

11-01-2007, 08:09 AM
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() (http://www.php.net/manual/en/function.number-format.php) page.

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