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 ... Quote 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 Quote 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 Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/83220-solved-circle-the-float/#findComment-423357 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.