Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F727112
D143.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 6, 6:56 AM
Size
643 B
Mime Type
text/x-diff
Expires
Tue, Jan 7, 6:56 AM (3 d, 49 m ago)
Engine
blob
Format
Raw Data
Handle
537174
Attached To
D143: INP-1491 - Round numbers in kFormatter before using "sprintf"
D143.diff
View Options
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
Log In to Comment