(percentage) Get the step that applies at a certain value.
761061
function getStep ( xPct, xSteps, snap, value ) {

        if ( value === 100 ) {
            return value;
        }

        var j = getJ( value, xPct ), a, b;

        // If 'snap' is set, steps are used as fixed points on the slider.
        if ( snap ) {

            a = xPct[j-1];
            b = xPct[j];

            // Find the closest position, a or b.
            if ((value - a) > ((b-a)/2)){
                return b;
            }

            return a;
        }

        if ( !xSteps[j-1] ){
            return value;
        }

        return xPct[j-1] + closest(
                value - xPct[j-1],
                xSteps[j-1]
            );
    }
588002
def valueAt( self, percent ):
        
        minim = self.minimum()
        maxim = self.maximum()
        rtype = self.rulerType()
        
        # simple minimum
        if ( percent <= 0 ):
            return minim
        
        # simple maximum
        elif ( 1 <= percent ):
            return maxim
        
        # calculate a numeric percentage value
        elif ( rtype == XChartRuler.Type.Number ):
            return (maxim - minim) * percent
        
        # calculate a time percentage value
        elif ( rtype in (XChartRuler.Type.Datetime, XChartRuler.Type.Time) ):
            maxsecs = minim.secsTo(maxim)
            
            diff = maxssecs * percent
            return minim.addSecs(diff)
            
        # calculate a date percentage value
        elif ( rtype == XChartRuler.Type.Date ):
            maxdays = minim.daysTo(maxim)
            
            diff = maxdays * percent
            return minim.addDays(diff)
            
        # otherwise, compare against the notches
        else:
            perc    = 0.0
            notches = self.notches()
            count   = len(notches)
            count  += self.padStart() + self.padEnd()
            count   = max(1, count - 1)
            
            perc    = float(self.padStart()) / count
            last    = None
            
            for i, notch in enumerate(notches):
                perc += float(i) / count
                if ( perc <= percent ):
                    break
                
                last = notch
            
            return last
44996
function (parts, target) {
      var o = target !== undefined ? target : Global;      
      for (var i = 0; i < parts.length; ++i)
        o = step(o, parts[i]);
      return o;
    }
524495
public function PercentageX()
    {
        if ($field = $this->owner->FocusPoint) {
            return round(DBFocusPoint::focusCoordToOffset($field->getX()) * 100);
        }
        return 0;
    }
123722
def percent_cb(name, complete, total):
    
    logger.debug(
        "{}: {} transferred out of {}".format(
            name, sizeof_fmt(complete), sizeof_fmt(total)
        )
    )
    progress.update_target(name, complete, total)
52060
def percentage(value: str) -> float:
    
    try:
        fvalue = float(value)
        assert 0 <= fvalue <= 100
    except (AssertionError, TypeError, ValueError):
        raise ArgumentTypeError(
            "{!r} is an invalid percentage value".format(value))
    return fvalue
820932
function(value, offset) {
    offset = offset || 1;
    var roundedValue = value;

    if (this.standard_deviation > 0.1) {
      var multiplier = Math.pow(10, -offset);
      roundedValue = Math.round(value * multiplier) / multiplier;

      if (roundedValue > this.min) {
        return this.round(value - this.step);
      }
    }
    return roundedValue;
  }
532927
def match_percentage(self):
        
        return int(self._percentages_and_ratings_xpb.
                   div.with_class('matchgraph--match').
                   div.with_class('matchgraph-graph').
                   canvas.select_attribute_('data-pct').
                   one_(self.profile_tree))
1011138
function toStepping ( xVal, xPct, value ) {

        if ( value >= xVal.slice(-1)[0] ){
            return 100;
        }

        var j = getJ( value, xVal ), va, vb, pa, pb;

        va = xVal[j-1];
        vb = xVal[j];
        pa = xPct[j-1];
        pb = xPct[j];

        return pa + (toPercentage([va, vb], value) / subRangeRatio (pa, pb));
    }
722565
def percentAt(self, value):
        
        min_val = self.minimum()
        max_val = self.maximum()
        
        if value < min_val:
            return 0.0
        elif max_val < value:
            return 1.0
        
        # round the max value to sync with the values in the grid
        max_val = self.rounded(max_val)
        
        try:
            perc = (value - min_val) / float(max_val - min_val)
        except (TypeError, ZeroDivisionError):
            return 0.0
        
        return max(min(perc, 1.0), 0.0)
513356
def percent(self, value: float) -> 'Size':
        """"""
        raise_not_number(value)
        self.maximum = '{}%'.format(value)
        return self
434618
def get_brightness_level(cls, percent):
        
        # Clamp to appropriate range.
        percent = min(100, max(0, percent))

        # Map 0-100 to 2-27
        value = int(2 + ((float(percent) / 100) * 25))
        return percent, value
651169
public Result getResult(boolean percentage)
    {
        float p = A_cap_B_size / (float) B_size;
        float r = A_cap_B_size / (float) A_size;
        if (percentage)
        {
            p *= 100;
            r *= 100;
        }
        float oov_r = Float.NaN;
        if (OOV > 0)
        {
            oov_r = OOV_R / (float) OOV;
            if (percentage)
                oov_r *= 100;
        }
        float iv_r = Float.NaN;
        if (IV > 0)
        {
            iv_r = IV_R / (float) IV;
            if (percentage)
                iv_r *= 100;
        }
        return new Result(p, r, 2 * p * r / (p + r), oov_r, iv_r);
    }
108285
public static int getPercentage(String percentage) {
        if (isNotEmpty(percentage) && isNumeric(percentage)) {
            int p = Integer.parseInt(percentage);
            return p;
        } else {
            return 0;
        }
    }
4837
def step(self, count=1):
    """"""
    return self._client.send(step=sc_pb.RequestStep(count=count))
171881
function (count, total, rounded) {
        var scale;
        if (rounded) {
            scale = this._0digitsScale;
        } else {
            scale = this._2digitsScale;
        }
        return Math.floor(this._percentage * scale * count / total) / scale;
    }
505403
def percentage(value, digits=2):
    '''
    

    '''

    value = float(value) * 100.0
    return u'' + '%s %%' % (_format(value, digits),)