say $number could be 1.0, 1.5, 2.0, 2.5, 3.0, 3.5 ... I want to display as 1, 1.5, 2, 2.5, 3, 3.5 ...
I use this small trick to do the work.
<?php echo($number*10/10); ?>
It is very simple. But it is kind tricky, in case new php version change the way handling number, it might not work in the future. Plus, it might not be clear to other programmers.
Is there a good clear function I can use to do the above works? thanks!