asmith Posted December 26, 2007 Share Posted December 26, 2007 hey guys is there a build-in function in php to circle a float number (to integer)? hmm sorry i don't know the exact word for it in english : like it turns 2.5 to 2 . 3.67 to 3 ... Link to comment https://forums.phpfreaks.com/topic/83220-solved-circle-the-float/ Share on other sites More sharing options...
~n[EO]n~ Posted December 26, 2007 Share Posted December 26, 2007 I think number_format Link to comment https://forums.phpfreaks.com/topic/83220-solved-circle-the-float/#findComment-423335 Share on other sites More sharing options...
asmith Posted December 26, 2007 Author Share Posted December 26, 2007 it makes a difference between upper than .5 and others , like : 4.5 => 5 4.49 => 4 4.67 =>5 hmm and of course puts "," ofr each thousands Link to comment https://forums.phpfreaks.com/topic/83220-solved-circle-the-float/#findComment-423337 Share on other sites More sharing options...
PHP_PhREEEk Posted December 26, 2007 Share Posted December 26, 2007 If you always want it rounded down, use floor() PhREEEk Link to comment https://forums.phpfreaks.com/topic/83220-solved-circle-the-float/#findComment-423343 Share on other sites More sharing options...
asmith Posted December 26, 2007 Author Share Posted December 26, 2007 exactly what i needed ! thanks ! really thanks Link to comment https://forums.phpfreaks.com/topic/83220-solved-circle-the-float/#findComment-423357 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.