From 9acf4fc46c7695ef29124d787ea97a5fcfbb324a Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Thu, 31 Jul 2014 20:57:10 +0200 Subject: [PATCH] Removing dead code --- src/Utility/Number.php | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/Utility/Number.php b/src/Utility/Number.php index 09839a9dd6b..3ed3b9536bc 100644 --- a/src/Utility/Number.php +++ b/src/Utility/Number.php @@ -252,36 +252,6 @@ public static function formatDelta($value, array $options = array()) { return static::format($value, $options); } -/** - * Alternative number_format() to accommodate multibyte decimals and thousands < PHP 5.4 - * - * @param float $value Value to format. - * @param int $places Decimal places to use. - * @param string $decimals Decimal position string. - * @param string $thousands Thousands separator string. - * @return string - */ - protected static function _numberFormat($value, $places = 0, $decimals = '.', $thousands = ',') { - if (!isset(self::$_numberFormatSupport)) { - self::$_numberFormatSupport = version_compare(PHP_VERSION, '5.4.0', '>='); - } - if (self::$_numberFormatSupport) { - return number_format($value, $places, $decimals, $thousands); - } - $value = number_format($value, $places, '.', ''); - $after = ''; - $foundDecimal = strpos($value, '.'); - if ($foundDecimal !== false) { - $after = substr($value, $foundDecimal); - $value = substr($value, 0, $foundDecimal); - } - while (($foundThousand = preg_replace('/(\d+)(\d\d\d)/', '\1 \2', $value)) !== $value) { - $value = $foundThousand; - } - $value .= $after; - return strtr($value, array(' ' => $thousands, '.' => $decimals)); - } - /** * Formats a number into a currency format. *