Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138192

How to get scaled down output from given range of numbers

$
0
0

I have two numbers MAX = 200, MIN = 110 now a random number, let's say 120 which could only be between these two numbers(MAX & MIN).

Now I want to scale down MAX = 10, MIN = 1 & random number to its corresponding value between new MAX & MIN which in this case is 2. How can I write an optimised JavaScript function that can do that?


Viewing all articles
Browse latest Browse all 138192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>