Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F776225
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
Thu, Feb 6, 10:28 PM
Size
637 B
Mime Type
text/x-diff
Expires
Fri, Feb 7, 10:28 PM (56 m, 23 s)
Engine
blob
Format
Raw Data
Handle
558678
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