Posted By

adrianparr on 11/07/09


Tagged

Value percent percentage


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

edsonpavoni
foodlove


AS3 Convert a Value to a Percentage


 / Published in: ActionScript 3
 

  1. private function valueToPercent($value:Number, $min:Number, $max:Number):Number {
  2. var myPercent:Number;
  3. var difference:Number = $max - $min;
  4. myPercent = (($value - $min) / difference);
  5. return myPercent;
  6. }

Report this snippet  

You need to login to post a comment.