You are here

public function SassNumber::unitString in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/script/literals/SassNumber.php \SassNumber::unitString()

* Returns a string representation of the units. *

Return value

string the units

3 calls to SassNumber::unitString()
SassNumber::getUnits in phamlp/sass/script/literals/SassNumber.php
* Returns the units of this number. *
SassNumber::op_div in phamlp/sass/script/literals/SassNumber.php
* Divides this value by the value of other *
SassNumber::op_times in phamlp/sass/script/literals/SassNumber.php
* Multiplies this value by the value of other *

File

phamlp/sass/script/literals/SassNumber.php, line 421

Class

SassNumber
SassNumber class. Provides operations and type testing for Sass numbers. Units are of the passed value are converted the those of the class value if it has units. e.g. 2cm + 20mm = 4cm while 2 + 20mm =…

Code

public function unitString($numeratorUnits, $denominatorUnits) {
  return join(' * ', $numeratorUnits) . (!empty($denominatorUnits) ? ' / ' . join(' * ', $denominatorUnits) : '');
}