@beamylake opened this Issue on February 28th 2020

Hello,
we've encountered an rounding error (again) when displaying the ecommerce overview in german

Here's the english version, where everything is looking as expected:

eng

And here is the german version, where the Ecommerce Orders Conversion Rate gets rounded down to 0%:

deu

It feels like this problem might be a "leftover" of https://github.com/matomo-org/matomo/issues/15200

We are using Matomo 3.13.3 and the rest of our setup is still as described in https://github.com/matomo-org/matomo/issues/15240

Please let me know if you need any further information and thanks in advance for your efforts!

@tsteur commented on February 29th 2020 Member

Thanks @beamylake we'll have a look to see if we can reproduce this.

@pebosi commented on March 5th 2020 Contributor

I have the same problem on my current install:
in NumberFormater.php the method formatNumberWithPattern calls "replaceSymbols"
The php strtr function has a strange behaviour here. When i return the value before the call i get a correct result.
Can't reproduce on local machine, so maybe a specific php / server conf problem.

@sgiehl commented on March 5th 2020 Member

The php strtr function has a strange behaviour here. When i return the value before the call i get a correct result.

I would more likely assume the number formatting is done twice maybe. And after the number is converted to a german format it gets truncated when it's formatted again.

@pebosi could you try switching the language to english and check if the same problem exists?

@pebosi commented on March 5th 2020 Contributor

Would be nice to have the whole NumberFormat stuff based on Intl Component / Extension, with upgrade to Twig 3 #15573

@pebosi commented on March 5th 2020 Contributor

See the screenshots
conversion-rate-en
conversion-rate-german

@pebosi commented on March 5th 2020 Contributor

And now when returning the value above this line
$value = $this->replaceSymbols($value);

Eng:
conversion-rate-en-2

Deu:
conversion-rate-german-2

@pebosi commented on March 5th 2020 Contributor

Matomo version: 3.13.3
MySQL version: 10.0.38-MariaDB-0ubuntu0.16.04.1
PHP version: 7.3.15-3+ubuntu16.04.1+deb.sury.org+1

@pebosi commented on March 5th 2020 Contributor

The second screenshots show the correct value (maybe its better to have 2 digits like in the graph tooltip). But the dot is not replaced with a comma in german...

@sgiehl commented on March 5th 2020 Member

you try applying that linked PR. that should fix the issue

@pebosi commented on March 5th 2020 Contributor

Works!

@beamylake commented on March 11th 2020

We can confirm, it's working for us too!
Thnx!

This Issue was closed on March 11th 2020
Powered by GitHub Issue Mirror