Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F727022
D130.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, 5:14 AM
Size
637 B
Mime Type
text/x-diff
Expires
Tue, Jan 7, 5:14 AM (3 d, 1 h ago)
Engine
blob
Format
Raw Data
Handle
537090
Attached To
D130: INP-1478 - Cut tailing zeros for numbers with 0 in the middle
D130.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
@@ -181,7 +181,8 @@
if ( isset($options['cut_zeros']) && $options['cut_zeros'] ) {
// Remove trailing zeros in decimal part (including "." if any left at the end).
- $value = rtrim(preg_replace('/\.([1-9]*)[0]+$/', '.$1', $value), '.');
+ $value = preg_replace('/\.0+$/', '', $value);
+ $value = preg_replace('/(\.\d+?)0+$/', '$1', $value);
}
}
Event Timeline
Log In to Comment