View Full Version : Code for adding decimal places code

11-22-2010, 02:25 AM
Good day!

I want to know where I can put this code :

number_format($num), 2;

I have this 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..

11-22-2010, 06:46 AM
try this

echo number_format(mysql_result($result,$ctr,"inputqty"), 2, '.', '');