![]() |
script/math question
Well, I can't seem to find a algorithm/function for it.. :(
Like, if you have a music length, lets see 3mins and 2 secs 0 = 0 ---> 1 = 3.20mins 0 is 0 and 1 is max (3.20 mins) like percentage, but with lower number (0 -> 1) Or, if you have a rgb from a program (like paint) which is probably max 255 if I remember 0 = 0 1 = 255 Easy Example: Max: 2 0 = 0 0.1 = 0.2 0.2 = 0.4 0.3 = 0.6 0.4 = 0.8 0.5 = 1 0.6 = 1.2 0.7 = 1.4 0.8 = 1.6 0.9 = 1.8 1 = 2 I'm using this for a GuiProgressCtrl control.. |
(currentnumber/maxnumber)
(rgbvalue/255) (musicpos/musiclen) Is that what you're looking for? |
Yeah, for percentages you always just do (currentnumber/highestnumber)
0/anything = 0 anything/anything = 1 Get it? |
Just what I needed, Thank you both :)
Quote:
|
Not a problem!
|
| All times are GMT +2. The time now is 03:18 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.