chanchelkumar Posted November 20, 2008 Share Posted November 20, 2008 Hi all, Am doing some calculations say 5*2.5=12.5 But i want to get the ans as..12.50, But now it is getting like 12.5.. How will i get this? Any one please help me.. Quote Link to comment Share on other sites More sharing options...
waynewex Posted November 20, 2008 Share Posted November 20, 2008 12.5 is the same as 12.50? Quote Link to comment Share on other sites More sharing options...
zenag Posted November 20, 2008 Share Posted November 20, 2008 use nymber_format... $number=111.90; echo number_format($number,2,'.',''); Quote Link to comment Share on other sites More sharing options...
Gighalen Posted November 20, 2008 Share Posted November 20, 2008 Or you could try using something like: <?php round($value, 2) ?> I think. I'm not sure. Quote Link to comment Share on other sites More sharing options...
chanchelkumar Posted November 21, 2008 Author Share Posted November 21, 2008 use nymber_format... $number=111.90; echo number_format($number,2,'.',''); Thanks Ganesh... It works... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.