Home > Article > Backend Development > Note on PHP functions
1.sprintf('%.1f',$str) is weird, is it rounding?
<?php echo sprintf('%.1f',7.52); // 7.5 echo "\n"; echo sprintf('%.1f',7.55); // 7.5 echo "\n"; echo sprintf('%.1f',7.56); // 7.6