Move cast into buildPrecision()
authorvlakoff <vlakoff@gmail.com>
Sat, 29 Oct 2016 08:09:20 +0000 (10:09 +0200)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Tue, 1 Nov 2016 06:52:11 +0000 (07:52 +0100)
bin/cleancss
lib/clean.js
lib/selectors/simple.js

index f4030b9..2428466 100755 (executable)
@@ -74,7 +74,7 @@ var options = {
   rebase: commands.skipRebase ? false : true,
   restructuring: commands.skipRestructuring ? false : true,
   root: commands.root,
-  roundingPrecision: commands.roundingPrecision === undefined ? undefined : parseInt(commands.roundingPrecision),
+  roundingPrecision: commands.roundingPrecision,
   semanticMerging: commands.semanticMerging ? true : false,
   shorthandCompacting: commands.skipShorthandCompacting ? false : true,
   sourceMap: commands.sourceMap,
index e92d324..4838c8d 100644 (file)
@@ -55,7 +55,7 @@ var CleanCSS = module.exports = function CleanCSS(options) {
     relativeTo: options.relativeTo,
     restructuring: undefined === options.restructuring ? true : !!options.restructuring,
     root: options.root || process.cwd(),
-    roundingPrecision: undefined === options.roundingPrecision ? undefined : parseInt(options.roundingPrecision),
+    roundingPrecision: options.roundingPrecision,
     semanticMerging: undefined === options.semanticMerging ? false : !!options.semanticMerging,
     shorthandCompacting: undefined === options.shorthandCompacting ? true : !!options.shorthandCompacting,
     sourceMap: options.sourceMap,
index 7549055..5b8b339 100644 (file)
@@ -393,7 +393,7 @@ function buildPrecision(options) {
 
   precision.value = options.roundingPrecision === undefined ?
     DEFAULT_ROUNDING_PRECISION :
-    options.roundingPrecision;
+    parseInt(options.roundingPrecision);
   precision.multiplier = Math.pow(10, precision.value);
   precision.regexp = new RegExp('(\\d*\\.\\d{' + (precision.value + 1) + ',})px', 'g');