mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
apply the streams fixes manually until the addition of the streams library is sorted
This commit is contained in:
@@ -38,12 +38,14 @@ class Utils
|
||||
}
|
||||
|
||||
if ($number < 1e+21 && $number >= 1e-6) {
|
||||
$formatted = number_format($number, 7, '.', '');
|
||||
$formatted = rtrim($formatted, '.0');
|
||||
$formatted = sprintf('%F', $number);
|
||||
$formatted = rtrim($formatted, '0'); // first remove all zeros at the end
|
||||
$formatted = rtrim($formatted, '.'); // If the string now ends with a decimal point, then remove it, too.
|
||||
} else {
|
||||
$formatted = sprintf('%e', $number);
|
||||
$parts = explode('e', $formatted);
|
||||
$parts[0] = rtrim($parts[0], '.0');
|
||||
$parts[0] = rtrim($parts[0], '0');
|
||||
$parts[0] = rtrim($parts[0], '.');
|
||||
$formatted = implode('e', $parts);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user