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

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 :smiley:

Accept the answer ! :D

Bye!