@param int $percent

@return mixed
420843
public function saturate($percent)
    {
        $color = $this->toHsl();
        $saturation = $this->clamp(($color->saturation() + $percent) / 100);
        return $color->saturation($saturation * 100)->back($this);
    }
659555
public function darken($percent)
    {
        $color = $this->toHsl();
        $lightness = $this->clamp(($color->lightness() - $percent) / 100);
        return $color->lightness($lightness * 100)->back($this);
    }
627951
private static function percent($number, float $total, int $decimal = 2): string
	{
		return Number::percent(self::prepareFloat($number), $total, $decimal);
	}
383014
def _percent_to_integer(percent):
    
    num = float(percent.split('%')[0]) / 100.0 * 255
    e = num - math.floor(num)
    return e < 0.5 and int(math.floor(num)) or int(math.ceil(num))
1352852
function createPercentComplete() {
    $cnt = count( $this->percentcomplete );
    if( 0 >= $cnt )
      return;
    $attributes = $this->_createParams( $this->percentcomplete['params'] );
    return $this->_createElement( 'PERCENT-COMPLETE', $attributes, $this->percentcomplete['value'] );
  }
1131925
protected function _color_luminance( $hex, $percent ) {
		$hex        = $this->_hex_normalization( $hex );
		$hue        = $this->_get_hue( $hex );
		$saturation = $this->_get_saturation( $hex );
		$luminance  = $this->_get_luminance( $hex );

		// Add luminance.
		$luminance += $percent * 100;
		$luminance  = ( 100 < $luminance ) ? 100 : $luminance;
		$luminance  = ( 0 > $luminance ) ? 0 : $luminance;

		$hex = $this->_convert_hsl_to_hex( $hue, $saturation, $luminance );
		return $hex;
	}
216958
public function shade($percent = 50)
    {
        $clone = clone $this;
        $black = $clone->toRgb()->red(0)->green(0)->blue(0);
        return $this->mix($black, $percent);
    }
416525
public function getSeriePercentile($Serie = "Serie1", $Percentil = 95)
    {
        if (!isset($this->Data["Series"][$Serie]["Data"])) {
            return null;
        }

        $Values = count($this->Data["Series"][$Serie]["Data"]) - 1;
        if ($Values < 0) {
            $Values = 0;
        }

        $PercentilID = floor(($Values / 100) * $Percentil + .5);
        $SortedValues = $this->Data["Series"][$Serie]["Data"];
        sort($SortedValues);

        if (is_numeric($SortedValues[$PercentilID])) {
            return $SortedValues[$PercentilID];
        }
        return null;
    }
544982
public function percentTranslated($locale)
    {
        $lang          = $this->findByLocale($locale);
        $referenceLang = $this->findByLocale($this->defaultLocale);

        $langEntries      = $lang->translations()->count();
        $referenceEntries = $referenceLang->translations()->count();

        return $referenceEntries > 0 ? (int) round($langEntries * 100 / $referenceEntries) : 0;
    }
640460
public static function percentUnEscape($string)
  {
    // Next, repeatedly percent-unescape the URL until it has no more percent-escapes.
    // this is not trivial, because the percent character could be in the url, when are we done?
    // lets unescape till there are no more percentages, or the only percentages are %25 (the % char)
    $keep_unescaping=true;
    while($keep_unescaping){
      if(strpos($string, '%')===false){
        // no % found, done
        break;
      }
      // replace al %25 sequences
      $test_string=preg_replace('#%25#s', '', $string);
      // now see if any % left
      // no? then we must decode exactly one more time
      if(strpos($test_string, '%')===false){
        // no % found
        $keep_unescaping=false;
      }
      $dec_string=urldecode($string);
      if($dec_string==$string){
        // decoding has no effect, bail out
        break;
      }
      $string=$dec_string;
    }
    return $string;
  }
102229
public static function percentage($total, $actual, $round = 1)
    {
        // Avoid useless calculations
        if ($total == 0 || $actual == 0) {
            return 0;
        }

        $value = 100 * $actual / $total;

        if (is_integer($round)) {
            $value = round($value, $round);
        }

        return $value;
    }
505403
def percentage(value, digits=2):
    '''
    

    '''

    value = float(value) * 100.0
    return u'' + '%s %%' % (_format(value, digits),)
203933
public static function calculate_percentage($numerator, $denominator, $decimals = 2, $dec_point = '.', $thousands_sep = ',')
    {
        return number_format(($numerator / $denominator) * 100, $decimals, $dec_point, $thousands_sep);
    }
1089227
public function calculatePercentage($decimal = 1)
    {
        // Profile not loaded yet.
        if (is_null($this->percentile)) {
            return null;
        }

        // Calculate percentage and return value
        return (float) number_format($this->percentile * 100, $decimal, '.', '');
    }
1175535
function (percent) {
            var rounded = Math.round(percent / this.coords.p_step) * this.coords.p_step;

            if (rounded > 100) {
                rounded = 100;
            }
            if (percent === 100) {
                rounded = 100;
            }

            return this.toFixed(rounded);
        }
861976
public static function success($percent, $htmlOptions = array())
    {
        ArrayHelper::addValue('class', Enum::COLOR_SUCCESS, $htmlOptions);
        return static::bar($percent, $htmlOptions);
    }
744668
public function format($value)
    {
        if ($value instanceOf Percentage) {
            $value = $value->toPercent();
        }

        return $value->int().'%';
    }