Leafo\ScssPhp\Compiler::coercePercent PHP Method

coercePercent() protected method

Coerce value to a percentage
protected coercePercent ( array $value ) : integer | float
$value array
return integer | float
    protected function coercePercent($value)
    {
        if ($value[0] === Type::T_NUMBER) {
            if (!empty($value[2]['%'])) {
                return $value[1] / 100;
            }
            return $value[1];
        }
        return 0;
    }
Compiler