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 https://forums.phpfreaks.com/topic/259383-how-do-i-explode-a-round/ 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 https://forums.phpfreaks.com/topic/259383-how-do-i-explode-a-round/#findComment-1329687 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.