SassNumber::coerce PHP Method

coerce() public method

The conversion takes into account the relationship between e.g. mm and cm, as well as between e.g. in and cm. If this number is unitless, it will simply return itself with the given units.
public coerce ( array $numeratorUnits, array $denominatorUnits ) : SassNumber
$numeratorUnits array
$denominatorUnits array
return SassNumber
    public function coerce($numeratorUnits, $denominatorUnits)
    {
        return new SassNumber(($this->isUnitless() ? $this->value : $this->value * $this->coercionFactor($this->numeratorUnits, $numeratorUnits) / $this->coercionFactor($this->denominatorUnits, $denominatorUnits)) . join(' * ', $numeratorUnits) . (!empty($denominatorUnits) ? ' / ' . join(' * ', $denominatorUnits) : ''));
    }