From 9f8cb8754d6d610d6de5b9e78f11c7984cc3d1cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Magnus=20K=C3=BChn?= Date: Fri, 18 May 2012 20:06:24 +0200 Subject: [PATCH] Renamed $minDecimals to $maxDecimals. --- wcfsetup/install/files/lib/util/StringUtil.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/util/StringUtil.class.php b/wcfsetup/install/files/lib/util/StringUtil.class.php index 95d9cb507f..3f12fb671c 100644 --- a/wcfsetup/install/files/lib/util/StringUtil.class.php +++ b/wcfsetup/install/files/lib/util/StringUtil.class.php @@ -190,17 +190,17 @@ final class StringUtil { * @param integer $minDecimals * @return string */ - public static function formatDouble($double, $minDecimals = 0) { + public static function formatDouble($double, $maxDecimals = 0) { // consider as integer, if no decimal places found - if (!$minDecimals && preg_match('~^(-?\d+)(?:\.(?:0*|00[0-4]\d*))?$~', $double, $match)) { + if (!$maxDecimals && preg_match('~^(-?\d+)(?:\.(?:0*|00[0-4]\d*))?$~', $double, $match)) { return self::formatInteger($match[1]); } // round - $double = round($double, ($minDecimals > 2 ? $minDecimals : 2)); + $double = round($double, ($maxDecimals > 2 ? $maxDecimals : 2)); // remove last 0 - if ($minDecimals < 2 && substr($double, -1) == '0') $double = substr($double, 0, -1); + if ($maxDecimals < 2 && substr($double, -1) == '0') $double = substr($double, 0, -1); // replace decimal point $double = str_replace('.', WCF::getLanguage()->get('wcf.global.decimalPoint'), $double); -- 2.20.1