Revert "Multi-language support"

This reverts commit aa9e0b708b.
This commit is contained in:
bergware
2020-06-20 18:35:32 +02:00
parent e174464369
commit 56c9769d07
+2 -2
View File
@@ -19,7 +19,7 @@ function my_scale($value, &$unit, $decimals=NULL, $scale=NULL, $kilo=1000) {
global $display,$language;
$scale = $scale ?? $display['scale'];
$number = $display['number'] ?? '.,';
$units = explode(' ', ' '.($language['prefix_SI'] ?? 'K M G T P E Z Y'));
$units = explode(' ', ' '.($kilo==1000 ? ($language['prefix_SI'] ?? 'K M G T P E Z Y') : ($language['prefix_IEC'] ?? 'Ki Mi Gi Ti Pi Ei Zi Yi')));
$size = count($units);
if ($scale==0 && ($decimals===NULL || $decimals<0)) {
$decimals = 0;
@@ -32,7 +32,7 @@ function my_scale($value, &$unit, $decimals=NULL, $scale=NULL, $kilo=1000) {
if ($decimals===NULL) $decimals = $value>=100 ? 0 : ($value>=10 ? 1 : (round($value*100)%100===0 ? 0 : 2));
elseif ($decimals<0) $decimals = $value>=100||round($value*10)%10===0 ? 0 : abs($decimals);
if ($scale<0 && round($value,-1)==1000) {$value = 1; $base++;}
$unit = $units[$base].($kilo==1000 ? _('B') : '');
$unit = $units[$base]._('B');
}
return number_format($value, $decimals, $number[0], $value>9999 ? $number[1] : '');
}