Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1046587
D143.id439.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
Sat, Jun 28, 8:52 PM
Size
594 B
Mime Type
text/x-diff
Expires
Sun, Jun 29, 8:52 PM (6 h, 18 m)
Engine
blob
Format
Raw Data
Handle
676604
Attached To
D143: INP-1491 - Round numbers in kFormatter before using "sprintf"
D143.id439.diff
View Options
Index: core/kernel/utility/formatters/formatter.php
===================================================================
--- core/kernel/utility/formatters/formatter.php
+++ 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') 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