webguync Posted November 25, 2008 Share Posted November 25, 2008 I want the following to calculate two decimals to something like 97.5 $HS_new[] = ($row['HS_new']/55)*100;//used on 55 question exams I tried $HS_new[] = ($row['HS_new']/55)*100,2;//used on 55 question exams but that gives me an error. What would be the correct syntax? Quote Link to comment https://forums.phpfreaks.com/topic/134254-quick-rounding-question/ Share on other sites More sharing options...
Mchl Posted November 25, 2008 Share Posted November 25, 2008 round Quote Link to comment https://forums.phpfreaks.com/topic/134254-quick-rounding-question/#findComment-698881 Share on other sites More sharing options...
webguync Posted November 25, 2008 Author Share Posted November 25, 2008 thanks, I read the manual and I am still a bit confused on the syntax as it relates to my string and where I would place ,2 to round two decimals. Quote Link to comment https://forums.phpfreaks.com/topic/134254-quick-rounding-question/#findComment-698895 Share on other sites More sharing options...
revraz Posted November 25, 2008 Share Posted November 25, 2008 round($row['HS_new'], 2); Quote Link to comment https://forums.phpfreaks.com/topic/134254-quick-rounding-question/#findComment-698901 Share on other sites More sharing options...
DeanWhitehouse Posted November 25, 2008 Share Posted November 25, 2008 What numbers are you using. Show us what the beginning number is and the expected end number. Then we will be able to help better. Quote Link to comment https://forums.phpfreaks.com/topic/134254-quick-rounding-question/#findComment-698902 Share on other sites More sharing options...
webguync Posted November 25, 2008 Author Share Posted November 25, 2008 I've got in now. Thanks for all of the help! Quote Link to comment https://forums.phpfreaks.com/topic/134254-quick-rounding-question/#findComment-698908 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.