Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorStefan Giehl <stefan@matomo.org>2020-08-20 23:06:00 +0300
committerGitHub <noreply@github.com>2020-08-20 23:06:00 +0300
commite08e8551f316e299b47eda5e3ce550ef3ff8265a (patch)
tree5ab19a8be8d26c03a22b1e85e97d5d93e1715d37 /core
parentb5c59ba7a4ebe0681dd6db7b9cb82d13ad93b2fa (diff)
Fix formatting of metrics in milliseconds (#16325)
Diffstat (limited to 'core')
-rw-r--r--core/Columns/Dimension.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/Columns/Dimension.php b/core/Columns/Dimension.php
index 204afa7179..1ab927af5d 100644
--- a/core/Columns/Dimension.php
+++ b/core/Columns/Dimension.php
@@ -456,7 +456,11 @@ abstract class Dimension
case Dimension::TYPE_DURATION_S:
return $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = false);
case Dimension::TYPE_DURATION_MS:
- return $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = true);
+ $val = number_format($value / 1000, 2);
+ if ($val > 60) {
+ $val = round($val);
+ }
+ return $formatter->getPrettyTimeFromSeconds($val, $displayAsSentence = true);
case Dimension::TYPE_PERCENT:
return $formatter->getPrettyPercentFromQuotient($value);
case Dimension::TYPE_BYTE: