Monkuar Posted March 21, 2012 Share Posted March 21, 2012 $newrating = round($imageinfo['rating'],2); this outputs: 4.49 in my db rating is 4.4884 all i need is the 4.... would i use some type of preg_replace or something just to grab the first 1 before the decimal? (all i need is the first number before the decimal) Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted March 21, 2012 Share Posted March 21, 2012 round() $newrating = round($imageinfo['rating'],0); you had the 2 for 2 positions, is now set to zero 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.