diff --git a/plugins/cleanupNumericValues.js b/plugins/cleanupNumericValues.js index f1ed1a2d..c570dd73 100644 --- a/plugins/cleanupNumericValues.js +++ b/plugins/cleanupNumericValues.js @@ -1,6 +1,6 @@ 'use strict'; -var regNumericValues = /^([\-+]?\d*\.?\d+(\.\d+)?([eE][\-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/, +var regNumericValues = /^([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/, removeLeadingZero = require('../lib/svgo/tools').removeLeadingZero; /** @@ -26,7 +26,7 @@ exports.cleanupNumericValues = function(item, params) { if (match) { // round it to the fixed precision var num = +(+match[1]).toFixed(params.floatPrecision), - units = match[4] || ''; + units = match[3] || ''; // and remove leading zero if (params.leadingZero) {