How to calculate the percentage between two numbers using a third number

43 Views Asked by At

I'm sorry if my question was too stupid, this is my first question here and i'm too bad at math.

I'm trying to develop a program and i got into this problem. I have two numbers Mix and Max.

Let's say:

Mix = 1000 Max = 2000

and the actual price now is 1500.

So what i need now is to calculate what is the percentage from the max to the low using my number 1500.

I expect like 50%.

And maybe something like 10% for 1900. And 20% for 1800 and so on.

Numbers could be much bigger but not smaller as zero.