I need to translate a value in the range 1-320 to it’s equivalent value within the spread in the range 500-2500, and I need to do it in VBScript.
Is there a function similar to map() that can do this for me? I can’t include any external libraries in this particular use case.
You mean you want to convert any number between 1 and 320 to its corresponding number between 500 and 2500 such that 1 corresponds to 500 and 320 corresponds to 2500?
If so, you can do it as follows: Let
xbe your original number (between 1 and 320) andybe the target number (between 500 and 2500):In general, if you have a range
a1toa2and want to convert it to rangeb1tob2using