Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

Math: Percent that number is between two numbers

How can I figure out what percentage that one number is between two other numbers?

For example, the price of Commodity X is currently $12.34 per pound.
This week's low price was $11.11 per pound and this week's high price was $22.22 per pound.

I tried solving this with JavaScript but I have the math wrong:

var low = 11.11;
var high = 22.22;
var current = 12.34;
alert( current * low / high ); // This is not correct

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of MajorBigDeal
MajorBigDeal
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial