diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-01-28 08:10:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 08:10:25 +0300 |
commit | d4f09a7e022dbb5e504c5fd63a27866185e2b529 (patch) | |
tree | a775b04bef3e25044e2ff61d2b5a75c0bbbadde8 | |
parent | d2de026e46c4ea06b6e52cc7d1c92a353b7a0c2c (diff) |
do not double format evolution metrics in sms (#17152)
-rw-r--r-- | plugins/MobileMessaging/ReportRenderer/Sms.php | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/plugins/MobileMessaging/ReportRenderer/Sms.php b/plugins/MobileMessaging/ReportRenderer/Sms.php index 4225ca96e8..69db8c9293 100644 --- a/plugins/MobileMessaging/ReportRenderer/Sms.php +++ b/plugins/MobileMessaging/ReportRenderer/Sms.php @@ -88,15 +88,13 @@ class Sms extends ReportRenderer // evolution metrics formatting : // - remove monetary, percentage and white spaces to shorten SMS content // (this is also needed to be able to test $value != 0 and see if there is an evolution at all in SMSReport.twig) - // - adds a plus sign $reportData->filter( 'ColumnCallbackReplace', array( $evolutionMetrics, function ($value) use ($floatRegex) { $matched = preg_match($floatRegex, $value, $matches); - $formatted = $matched ? sprintf("%+d", $matches[0]) : $value; - return \Piwik\NumberFormatter::getInstance()->formatPercentEvolution($formatted); + return $matched ? (float) $matches[0] : $value; } ) ); |