For example, we have the formula 6*5/2 . If you count, then we get -15. And if we make such a formula 7*5/2 , then we will succeed - 17.5! Question: how to make the whole number remain unchanged, and add 0.5 to fractional numbers?
- 2How to make rounding? And then the phrase: Question: How to make sure that the whole number remains unchanged, and to add to fractional numbers 0.5 Just kills! - LordySL
- fourStop stop, what's up? 65/2 = 15 (32.5)? 75/2 = 17.5 (37.5)? - LordySL
|
2 answers
Example:
<?php $k=17,5; $k2 = round($k) echo $k2 ?> - @oOKomarOo checkbox) - LordySL
|
Up to ceil ($ num), down to floor ($ num), to the nearest side - round ($ num). Docks read .
|