Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous database entries for all rates because of localization #4360

Closed
anonymous-matomo-user opened this issue Dec 1, 2013 · 1 comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.

Comments

@anonymous-matomo-user
Copy link

All (conversion) rates in my Piwik installation were integer valued (1.0%, 2.0%, ) instead of (1.2%, 2.6%, etc.). The reason seems to be the localization of PHP. My Server is located in Germany and float numbers are represented by a decimal comma:

#!php
$floatNumber = 10 / 4;
print_r($floatNumber);
// output: 2,5

However, MySql doesn't understand the comma based floats and just seems to cut of all decimal places resulting in the integer valued rates. I've solved it by adding the following code line somewhere in the code

#!php
setlocale(LC_NUMERIC, 'C');

But probably there is a solution in not such a hacky way.

@mattab
Copy link
Member

mattab commented Dec 8, 2013

see #4114 format thousands, decimal, abbreviate large numbers locatization l10n

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

2 participants