Convert percentage offset on slide to equivalent model value
@param percent
@returns {*}
967781
function percentToValue(percent) {
      var adjustedPercent = invert ? (1 - percent) : percent;
      return (min + adjustedPercent * (max - min));
    }
904117
function (element) {
            var p = this.padding,
                w = this.canvas.width,
                h = this.canvas.height * 0.5;

            // Convert padding percentage to actual padding
            p = p.map(function (a, i) {
                return a * ((i % 2) ? w : h);
            });

            return [
                this.prettify((parseInt($(element).css("left"), 10)    - p[3]) / (w + p[1] + p[3])),
                this.prettify((h - parseInt($(element).css("top"), 10) - p[2]) / (h - p[0] - p[2]))
            ];
        }
1361141
function percentage(num) {
    const MAX_CHARACTERS = 4;
    const relativePercentage = Math.ceil(num * 100 / (100 / MAX_CHARACTERS));

    return `[${'▒'.repeat(relativePercentage)}${' '.repeat(MAX_CHARACTERS - relativePercentage)}]`;
}
350534
def from_percent(position_percent):
        """"""
        if not isinstance(position_percent, int):
            raise PyVLXException("Position::position_percent_has_to_be_int")
        if position_percent < 0:
            raise PyVLXException("Position::position_percent_has_to_be_positive")
        if position_percent > 100:
            raise PyVLXException("Position::position_percent_out_of_range")
        return bytes([position_percent*2, 0])
416710
def percentile(arr, percent):
    
    arr = sorted(arr)
    index = (len(arr) - 1) * percent
    floor = math.floor(index)
    ceil = math.ceil(index)
    if floor == ceil:
        return arr[int(index)]
    low_value = arr[int(floor)] * (ceil - index)
    high_value = arr[int(ceil)] * (index - floor)
    return low_value + high_value
129523
def percent_of_the_time(p):
    
    def decorator(fn):

        def wrapped(*args, **kwargs):
            if in_percentage(p):
                fn(*args, **kwargs)

        return wrapped

    return decorator
15520
private void slideKnob(Event event) {
		int x = DOM.eventGetClientX(event);
		if (x > 0) {
			int lineWidth = lineElement.getOffsetWidth();
			int lineLeft = lineElement.getAbsoluteLeft();
			double percent = (double) (x - lineLeft) / lineWidth * 1.0;
			setCurrentValue(getTotalRange() * percent + minValue, true);
		}
	}
189196
public static Num percentOf(Object percent, Object ofValue) {
        Num _x = new Num(percent);
        Num _y = new Num(ofValue);
        Calculator cPercent = Calculator.builder().openBracket().val(_x).div(100).closeBracket().mul(_y);
        return cPercent.calculate();
    }
1061431
function convertToPx(el, prop, value) {
        if (!isNaN(Number(value))) {
          return Number(value);
        } else if (/^\d+(\.\d+)?%$/.test(value)) {
          return percent_px(el, prop, value);
        } else if (value.match(/(vh|vw)/)) {
          var dimension = value.replace(/[0-9]/g, '');
          return relative_px(dimension, value);
        }

        // Converts vw or vh to PX
        function relative_px(type, value) {
          var w = window,
            d = document,
            e = d.documentElement,
            g = d.body,
            x = w.innerWidth || e.clientWidth || g.clientWidth,
            y = w.innerHeight || e.clientHeight || g.clientHeight;

          if (type === 'vw') {
            return (x * parseFloat(value)) / 100;
          } else if (type === 'vh') {
            return (y * parseFloat(value)) / 100;
          } else {
            return undefined;
          }
        }

        // Converts % to PX
        function percent_px(el, prop, percent) {
          var parent_width = Embedo.utils.compute(el.parentNode, prop, true);
          percent = parseFloat(percent);
          return parent_width * (percent / 100);
        }
      }
108285
public static int getPercentage(String percentage) {
        if (isNotEmpty(percentage) && isNumeric(percentage)) {
            int p = Integer.parseInt(percentage);
            return p;
        } else {
            return 0;
        }
    }
427815
function() {
      var val = Math.floor(this.options.minValue+(this.options.maxValue-this.options.minValue)*this.slider.getValue()/100);
      return val;
   }
505403
def percentage(value, digits=2):
    '''
    

    '''

    value = float(value) * 100.0
    return u'' + '%s %%' % (_format(value, digits),)
452168
function(percentage) {
					var min = (this.options.min === 0) ? 0 : Math.log(this.options.min);
					var max = Math.log(this.options.max);
					var value = Math.exp(min + (max - min) * percentage / 100);
					value = this.options.min + Math.round((value - this.options.min) / this.options.step) * this.options.step;
					/* Rounding to the nearest step could exceed the min or
					 * max, so clip to those values. */
					if (value < this.options.min) {
						return this.options.min;
					} else if (value > this.options.max) {
						return this.options.max;
					} else {
						return value;
					}
				}
21157
def percentOfTotal(self, value, values):
        
        try:
            return float(value) / sum(values)
        except (ZeroDivisionError, TypeError, ValueError):
            return 0.0
1156164
def percent(self, value) -> 'Gap':
        """"""
        raise_not_number(value)
        self.gap = '{}%'.format(value)
        return self
1334876
def to_percentage(number, rounding=2):
    
    number = float(number) * 100
    number_as_int = int(number)
    rounded = round(number, rounding)

    return '{}%'.format(number_as_int if number_as_int == rounded else rounded)
175247
function valueToX(value) {
    const
        rect = this.$.getBoundingClientRect(),
        percent = (value - this.min) / (this.max - this.min);
    return rect.width * percent;
}