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) 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 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
Archived
This topic is now archived and is closed to further replies.