From: Magnus Kühn Date: Fri, 18 May 2012 18:06:24 +0000 (+0200) Subject: Renamed $minDecimals to $maxDecimals. X-Git-Tag: 2.0.0_Beta_1~1101^2~2^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f8cb8754d6d610d6de5b9e78f11c7984cc3d1cc;p=GitHub%2FWoltLab%2FWCF.git Renamed $minDecimals to $maxDecimals. --- 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);