aboutsummaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-30 19:31:32 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-30 19:31:32 +0100
commit036240ab01999c8eff1b9b3a98a7313cf43f5836 (patch)
tree10adb38f50ca5ad2c64c1bb4170c3b1a14f63c58 /lib/lib_rss.php
parentee5bbe48269a2fd5bc9c175fdb1e5a92a2c04502 (diff)
Fix coding style formatNumber and formatBytes
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 3648a4582..317c6852f 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -56,16 +56,14 @@ function checkUrl($url) {
}
}
-function formatNumber($n, $precision = 0) {
- return str_replace(' ', ' ', //Espace insécable //TODO: remplacer par une espace _fine_ insécable
- number_format($n, $precision, '.', ' ')); //number_format does not seem to be Unicode-compatible
-}
function format_number($n, $precision = 0) {
- // TODO: coding style, prefer THIS function. Remove formatNumber.
- return formatNumber($n, $precision);
+ // number_format does not seem to be Unicode-compatible
+ return str_replace(' ', ' ', //Espace insécable //TODO: remplacer par une espace _fine_ insécable
+ number_format($n, $precision, '.', ' ')
+ );
}
-function formatBytes($bytes, $precision = 2, $system = 'IEC') {
+function format_bytes($bytes, $precision = 2, $system = 'IEC') {
if ($system === 'IEC') {
$base = 1024;
$units = array('B', 'KiB', 'MiB', 'GiB', 'TiB');
@@ -77,7 +75,7 @@ function formatBytes($bytes, $precision = 2, $system = 'IEC') {
$pow = $bytes === 0 ? 0 : floor(log($bytes) / log($base));
$pow = min($pow, count($units) - 1);
$bytes /= pow($base, $pow);
- return formatNumber($bytes, $precision) . ' ' . $units[$pow];
+ return format_number($bytes, $precision) . ' ' . $units[$pow];
}
function timestamptodate ($t, $hour = true) {