You are here

private function CSSCompression_Numeric::decimal in Advanced CSS/JS Aggregation 7

Same name and namespace in other branches
  1. 6 advagg_css_compress/css-compressor-3.x/src/lib/Numeric.inc \CSSCompression_Numeric::decimal()

Remove's unecessary decimal, ie 13.0px => 13px

Parameters

(string) str: Unit string:

1 call to CSSCompression_Numeric::decimal()
CSSCompression_Numeric::numeric in advagg_css_compress/css-compressor-3.x/src/lib/Numeric.inc
Runs all numeric operations

File

advagg_css_compress/css-compressor-3.x/src/lib/Numeric.inc, line 51

Class

CSSCompression_Numeric
CSS Compressor [VERSION] [DATE] Corey Hart @ http://www.codenothing.com

Code

private function decimal($str) {
  if (preg_match($this->rdecimal, $str, $match)) {
    $str = ($match[1] == '-' ? '-' : '') . floatval($match[2]) . $match[3];
  }
  return $str;
}