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 Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/157804-solved-result-calculate/#findComment-832283 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.