beansandsausages Posted September 24, 2008 Share Posted September 24, 2008 Hey freaks, i have a little problem, i have a formula to work out the % of a number, $value = $number_1 * 100 / $number_2; it works but some times it returns a value of 0.757337864% is there a way just to make it 2 decimal places? for example 00.75% ? Thank you. Link to comment https://forums.phpfreaks.com/topic/125589-solved-question/ Share on other sites More sharing options...
Adam Posted September 24, 2008 Share Posted September 24, 2008 Yeah: $value = round($value, 2); Link to comment https://forums.phpfreaks.com/topic/125589-solved-question/#findComment-649303 Share on other sites More sharing options...
beansandsausages Posted September 24, 2008 Author Share Posted September 24, 2008 haha i almost had it, my code $value = round($value, 0.2); thank you Link to comment https://forums.phpfreaks.com/topic/125589-solved-question/#findComment-649306 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.