RottNKorpse
Technical User
- Aug 8, 2006
- 13
Hi,
I have a question I can't seem to figure out on my own using tutorials or documentations so I was hoping someone here could help me out. Here is my problem.
I am using PHP and MySQL to do this script. I want to have a table that contains only numbers for data and then add them all up as a result to display and that I have accomplished with no problem and then I want to display a percentage of that number to the public however that also I have accomplished with no problem using round()...
The problem is I am trying to set a maximum number that it displays.
I want it to display 1-500 no matter what the number is or the decimal it may have is provided it doesnt exceed 500 but once it does I want it to display 500 as the limit so even if it is say 674 I want it to only display 500.
How would I go about doing this?
The sql I am using for the adding is SELECT SUM which works just fine and I am using round( $total_number *.15, 2) to display the percentage number of 15%. But not I am completely at a loss at what to do for the maximum number thing so any ideas?
I have a question I can't seem to figure out on my own using tutorials or documentations so I was hoping someone here could help me out. Here is my problem.
I am using PHP and MySQL to do this script. I want to have a table that contains only numbers for data and then add them all up as a result to display and that I have accomplished with no problem and then I want to display a percentage of that number to the public however that also I have accomplished with no problem using round()...
The problem is I am trying to set a maximum number that it displays.
I want it to display 1-500 no matter what the number is or the decimal it may have is provided it doesnt exceed 500 but once it does I want it to display 500 as the limit so even if it is say 674 I want it to only display 500.
How would I go about doing this?
The sql I am using for the adding is SELECT SUM which works just fine and I am using round( $total_number *.15, 2) to display the percentage number of 15%. But not I am completely at a loss at what to do for the maximum number thing so any ideas?