Page MenuHomeIn-Portal Phabricator

D143.diff
No OneTemporary

File Metadata

Created
Mon, Jan 6, 6:56 AM

D143.diff

Index: branches/5.2.x/core/kernel/utility/formatters/formatter.php
===================================================================
--- branches/5.2.x/core/kernel/utility/formatters/formatter.php
+++ branches/5.2.x/core/kernel/utility/formatters/formatter.php
@@ -177,6 +177,11 @@
}
if (isset($format) && $format) {
+ if ( substr($format, -1) === 'f' ) {
+ // High precision formats (e.g. '%01.20f') are not supported to keep code below as fast as possible.
+ $value = round($value, substr($format, -2, 1));
+ }
+
$value = sprintf($format, $value);
if ( isset($options['cut_zeros']) && $options['cut_zeros'] ) {

Event Timeline