View Full Version : Math woes lol
kildre
07-18-2002, 08:50 PM
Ok if I wanted to set a range from 0 - 100 but the actual range was like
10000 to 60000 but I wanted the 10000 to be represented by 0 and 60k of 100 percent.
Mathmatically how would I do this?
salary= 30000;
now I have ((_root.salary*2)*(_root.volume/100));
this creates 60K to 0 range... but I want 10k to act as zero.
thanks,
Kildre
CyanBlue
07-19-2002, 12:26 AM
So... You want 10k to be 0% and 60k to be 100%???
Meaning... 0k(10k - 10k) to 0% and 50k(60k - 10k) to be 100%, right???
So... if you want to know where 30k falls into... it shoud be something like... (30k - 10k) / 50k = 0.4
0.4 * 100 = 40(%)
Am I right???
simail
07-19-2002, 01:01 AM
hi CB
just as a thought although i'm sure i've got it wrong isn't it a straightforward
30/50 * 100/1 = 60%
i couldn't see where you got the .4 from?
regards
simail
sumul
07-19-2002, 01:31 AM
[((Number - 10000)/50000)*100] will map any number between 10000 and 60000 to a scale from 0 to 100. Try it: if number = 10000, you have 0%; if number = 60000, you have 100%; if number = 35000, you get 50%, etc ...
Is this what you're looking for? It's basically what CB was saying ...
simail
07-19-2002, 02:09 AM
yep i see what you mean:o
i've withdrawn the writ CB;)
regards
simail
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.