phprookie72 Posted February 9, 2012 Share Posted February 9, 2012 is there a math function that give you an integer value when u divide 2 numbers? ie in 7/3 i just want 2 as a result not floating number. thanks in advance. Link to comment https://forums.phpfreaks.com/topic/256750-math-function/ Share on other sites More sharing options...
smerny Posted February 9, 2012 Share Posted February 9, 2012 would floor() do what you want? http://php.net/manual/en/function.floor.php Link to comment https://forums.phpfreaks.com/topic/256750-math-function/#findComment-1316194 Share on other sites More sharing options...
AyKay47 Posted February 9, 2012 Share Posted February 9, 2012 depends, do you want the float to round up if it is .5 or greater? e.g. a divided value of 3.5 would return 4. Link to comment https://forums.phpfreaks.com/topic/256750-math-function/#findComment-1316197 Share on other sites More sharing options...
ManiacDan Posted February 9, 2012 Share Posted February 9, 2012 You want either floor() or round() (note that ceil() also exists) Link to comment https://forums.phpfreaks.com/topic/256750-math-function/#findComment-1316199 Share on other sites More sharing options...
phprookie72 Posted February 9, 2012 Author Share Posted February 9, 2012 thank you floor() will do what i want. Link to comment https://forums.phpfreaks.com/topic/256750-math-function/#findComment-1316250 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.