- Home /
attribute Percent used
Hi: I am wondering if there is a way to calculate a percent from a value that is used in between two values?
Example: 100 = 0% 150 = 100% if a value is 125, that would make it 50% compared to the min and max values above.
thanks: James
Comment
Best Answer
Answer by tormentoarmagedoom · Apr 06, 2018 at 10:46 PM
Good day.
Yea, of course:
float TheNumber
float ThePercentatge
float MinimumRange
float MaximumRange
ThePercentatge = (TheNumber-MinimumRange)/(MaximumRange-MinimumRange)*100
in our case:
50 = (125-100 / 150-100 ) * 100
Thats it :D
Accept the answer ! :D
Bye!
Your answer