Miko Posted May 12, 2009 Share Posted May 12, 2009 Hello, I've made a little script that calculates a percentage. The script works good and he calculates correctly, but some results are with several numbers after the , . I want to show only the 2 numbers after the , . Anyone knows how to do that? Thanks Link to comment https://forums.phpfreaks.com/topic/157804-solved-result-calculate/ Share on other sites More sharing options...
gevans Posted May 12, 2009 Share Posted May 12, 2009 http://uk.php.net/number_format <?php $number = 1234.5678; // english notation without thousands seperator $english_format_number = number_format($number, 2, '.', ''); // 1234.57 Link to comment https://forums.phpfreaks.com/topic/157804-solved-result-calculate/#findComment-832256 Share on other sites More sharing options...
Miko Posted May 12, 2009 Author Share Posted May 12, 2009 super thanks Link to comment https://forums.phpfreaks.com/topic/157804-solved-result-calculate/#findComment-832283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.