diff options
Diffstat (limited to 'plugins/MobileMessaging')
-rw-r--r-- | plugins/MobileMessaging/ReportRenderer/Sms.php | 3 | ||||
-rw-r--r-- | plugins/MobileMessaging/templates/SMSReport.twig | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/plugins/MobileMessaging/ReportRenderer/Sms.php b/plugins/MobileMessaging/ReportRenderer/Sms.php index f3c19d77b4..96b7291240 100644 --- a/plugins/MobileMessaging/ReportRenderer/Sms.php +++ b/plugins/MobileMessaging/ReportRenderer/Sms.php @@ -95,7 +95,8 @@ class Sms extends ReportRenderer $evolutionMetrics, function ($value) use ($floatRegex) { $matched = preg_match($floatRegex, $value, $matches); - return $matched ? sprintf("%+d", $matches[0]) : $value; + $formatted = $matched ? sprintf("%+d", $matches[0]) : $value; + return \Piwik\NumberFormatter::getInstance()->formatPercentEvolution($formatted); } ) ); diff --git a/plugins/MobileMessaging/templates/SMSReport.twig b/plugins/MobileMessaging/templates/SMSReport.twig index 3b234bb064..09f41ece80 100644 --- a/plugins/MobileMessaging/templates/SMSReport.twig +++ b/plugins/MobileMessaging/templates/SMSReport.twig @@ -12,32 +12,32 @@ {# visits #} {{- rowMetrics.nb_visits|number }} {{ 'General_ColumnNbVisits'|translate }} - {%- if rowMetrics.visits_evolution != 0 %} ({{ rowMetrics.visits_evolution|percent }}){%- endif -%} + {%- if rowMetrics.visits_evolution != 0 %} ({{ rowMetrics.visits_evolution|percentEvolution }}){%- endif -%} {%- if rowMetrics.nb_visits != 0 -%} {#- actions -#} , {{ rowMetrics.nb_actions|number }} {{ 'General_ColumnNbActions'|translate }} - {%- if rowMetrics.actions_evolution != 0 %} ({{ rowMetrics.actions_evolution|percent }}){%- endif -%} + {%- if rowMetrics.actions_evolution != 0 %} ({{ rowMetrics.actions_evolution|percentEvolution }}){%- endif -%} {%- if isGoalPluginEnabled -%} {# goal metrics #} {%- if rowMetrics.nb_conversions != 0 -%} , {{ 'General_ColumnRevenue'|translate }}: {{ rowMetrics.revenue|raw }} - {%- if rowMetrics.revenue_evolution != 0 %} ({{ rowMetrics.revenue_evolution|percent }}){%- endif -%} + {%- if rowMetrics.revenue_evolution != 0 %} ({{ rowMetrics.revenue_evolution|percentEvolution }}){%- endif -%} , {{ rowMetrics.nb_conversions|number }} {{ 'Goals_GoalConversions'|translate }} - {%- if rowMetrics.nb_conversions_evolution != 0 %} ({{ rowMetrics.nb_conversions_evolution|percent }}){%- endif -%} + {%- if rowMetrics.nb_conversions_evolution != 0 %} ({{ rowMetrics.nb_conversions_evolution|percentEvolution }}){%- endif -%} {%- endif -%} {# eCommerce metrics #} {%- if siteHasECommerce[rowMetadata.idsite] -%} , {{ 'General_ProductRevenue'|translate }}: {{ rowMetrics.ecommerce_revenue|raw }} - {%- if rowMetrics.ecommerce_revenue_evolution != 0 %} ({{ rowMetrics.ecommerce_revenue_evolution|percent }}){%- endif -%} + {%- if rowMetrics.ecommerce_revenue_evolution != 0 %} ({{ rowMetrics.ecommerce_revenue_evolution|percentEvolution }}){%- endif -%} , {{ rowMetrics.orders|number }} {{ 'General_EcommerceOrders'|translate }} - {%- if rowMetrics.orders_evolution != 0 %} ({{ rowMetrics.orders_evolution|percent }}){%- endif -%} + {%- if rowMetrics.orders_evolution != 0 %} ({{ rowMetrics.orders_evolution|percentEvolution }}){%- endif -%} {%- endif -%} {%- endif -%} |