Skip to content

Commit

Permalink
Removing dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jul 31, 2014
1 parent bfb9fb5 commit 9acf4fc
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/Utility/Number.php
Expand Up @@ -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.
*
Expand Down

0 comments on commit 9acf4fc

Please sign in to comment.