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. Quote Link to comment Share on other sites More sharing options...
Adam Posted September 24, 2008 Share Posted September 24, 2008 Yeah: $value = round($value, 2); Quote Link to comment 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 Quote Link to comment 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.