Accept a percentage and return it in pixels.

@param  string $value
@param  int $current_pixels
@return mixed
761965
public function percent($value, $current_pixels)
    {
        if (strpos($value, '%') !== false) {
            $value = str_replace('%', '', $value) * 0.01 * $current_pixels;
        }

        return $value;
    }
1048849
public function resolve($value)
    {
        try {
            foreach ($this->thenCallables as $then) {
                $value = $then($value);
            }
        } catch (\Exception $e) {
            foreach ($this->rejectCallables as $reject) {
                $e = $reject($e);
            }
        }

        return $value;
    }
236427
public static function getDisplayValue($value)
  {
    switch($value)
    {
      case self::ACTIVE:
        return 'Active';
      case self::ARCHIVED:
        return 'Archived';
      case self::PENDING:
        return 'Pending';
      case self::CORRUPT:
        return 'Corrupt';
      default:
        return $value;
    }
  }
1035596
private function getRatio(string $value) : float
    {
        if (strpos($value, '%') !== false) {
            $result = ((float)str_replace('%', '', $value)) / 100;
        } else {
            $result = $value;
        }

        return (float)$result;
    }
1301681
public function value($value = null)
    {
        if (is_numeric($value)) {
            $this->value = $value >= 0 && $value <= 100 ? $value : $this->value;
            return $this;
        }
        return (int) $this->value;
    }
767680
public function real_grade_value($value, $max) {
        $localized = true;
        if (is_null($value) or $value === '') {
            return null;
        } elseif ($max == 0) {
            return 0;
        } else {
            return format_float($max * $value / 100, $this->gradedecimals, $localized);
        }
    }
33192
public function get($value) {
        //TODO throw exception instead?!
        if (\is_int($value)) {
            $info = $this->getIndexAndMask($value);
            $i = $info["i"];
            $k = $info["k"];

            $flag = 1;
            $flag = $flag << $k;

            if (isset($this->array[$i])) return (($this->array[$i] & $flag) !== 0);
            return false;
        }
        return false;
    }
840544
public function hasTaxPercent($value)
    {
        $percent = $this->sanitizePercent($value);

        return isset($this->perTaxRate[$percent]);
    }
505411
public float getFloatPixelValue(GriddedTile griddedTile, Double value) {

		double pixel = 0;
		if (value == null) {
			if (griddedCoverage != null) {
				pixel = griddedCoverage.getDataNull();
			}
		} else {
			pixel = valueToPixelValue(griddedTile, value);
		}

		float pixelValue = (float) pixel;

		return pixelValue;
	}
106766
def set_pixel(self, x, y, value):
        
        if x < 0 or x > 7 or y < 0 or y > 15:
            # Ignore out of bounds pixels.
            return
        self.set_led((7 - x) * 16 + y, value)
411454
function (value, no_min) {
            var diapason = this.options.max - this.options.min,
                one_percent = diapason / 100,
                val, percent;

            if (!diapason) {
                this.no_diapason = true;
                return 0;
            }

            if (no_min) {
                val = value;
            } else {
                val = value - this.options.min;
            }

            percent = val / one_percent;

            return this.toFixed(percent);
        }
828193
public static function to360Range($value)
    {
        if ($value > 360) {
            return $value * 1.0 - floor($value / 360) * 360;
        } elseif ($value < 0) {
            return $value * 1.0 + (floor(-$value / 360) + 1) * 360;
        }
        return $value;
    }
12615
private function return_($value) {
        if (abs($value) === INF) {
            return $value;
        } else if ($value === 'INF') {
            return INF;
        } else if ($value === '-INF') {
            return -INF;
        } else {
            return (float) $value;
        }
    }
932766
function Check($value)
    {
        if (!ctype_digit(Str::TrimLeft($value, '-')))
            $this->error = self::HasNonDigits;
        else
        {
            $floatValue = (float)$value;
            if ($floatValue < $this->min)
            {
                 $this->error = self::ExceedsMin;
            }
            else if ($floatValue > $this->max)
                $this->error = self::ExceedsMax;
        }
        return $this->error == '';
    }
1124769
public static function float($value){

		$value = static::_nullValue($value);

		if($value !== null){

			// Avoid decimal separator nonsense
			$value = str_replace(',', '.', $value);
			$value = (float) $value;
		}

		return $value;
	}
1156164
def percent(self, value) -> 'Gap':
        """"""
        raise_not_number(value)
        self.gap = '{}%'.format(value)
        return self
1252780
function setPercentComplete( $value, $params=FALSE ) {
    $this->percentcomplete['value']  = $value;
    $this->percentcomplete['params'] = $this->_setParams( $params );
  }