aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-03-22 08:37:29 +0000
committerMario <mario@mariovavti.com>2024-03-22 08:37:29 +0000
commit1aeb05628b6a2a069c46980efbe628362c9e3e74 (patch)
treee9aed15d0cd74e0c23dcb05c7be8fe9541efdf36 /vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php
parent5b7387459cf4de8f7354d81cb0392c4225714d94 (diff)
parentb464fae3bf22585888c5f3def8eded76fd48ed16 (diff)
downloadvolse-hubzilla-1aeb05628b6a2a069c46980efbe628362c9e3e74.tar.gz
volse-hubzilla-1aeb05628b6a2a069c46980efbe628362c9e3e74.tar.bz2
volse-hubzilla-1aeb05628b6a2a069c46980efbe628362c9e3e74.zip
Merge branch '9.0RC'9.0
Diffstat (limited to 'vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php')
-rw-r--r--vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php
index 166f3bf30..b5a1eab5c 100644
--- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php
+++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php
@@ -261,7 +261,7 @@ class HTMLPurifier_UnitConverter
*/
private function round($n, $sigfigs)
{
- $new_log = (int)floor(log(abs($n), 10)); // Number of digits left of decimal - 1
+ $new_log = (int)floor(log(abs((float)$n), 10)); // Number of digits left of decimal - 1
$rp = $sigfigs - $new_log - 1; // Number of decimal places needed
$neg = $n < 0 ? '-' : ''; // Negative sign
if ($this->bcmath) {
@@ -276,7 +276,7 @@ class HTMLPurifier_UnitConverter
}
return $n;
} else {
- return $this->scale(round($n, $sigfigs - $new_log - 1), $rp + 1);
+ return $this->scale(round((float)$n, $sigfigs - $new_log - 1), $rp + 1);
}
}
@@ -300,7 +300,7 @@ class HTMLPurifier_UnitConverter
// Now we return it, truncating the zero that was rounded off.
return substr($precise, 0, -1) . str_repeat('0', -$scale + 1);
}
- return sprintf('%.' . $scale . 'f', (float)$r);
+ return number_format((float)$r, $scale, '.', '');
}
}