Covered by automated tests
To test manually:
Covered by automated tests To test manually: Install/switch to French (fr) language pack Create new report from Users report source, containing following columns Lastname ( Nom ) Confirmed ( Confirmé ) Change aggregation method of the Confirmed column to Average ( Moyenne ) Percent ( Pourcentage ) Confirm column values are formatted using localised format (comma decimal separator) for each
- Install/switch to French (fr) language pack
- Create new report from Users report source, containing following columns
- Lastname (Nom)
- Confirmed (Confirmé)
- Change aggregation method of the Confirmed column to
- Average (Moyenne)
- Percent (Pourcentage)
- Confirm column values are formatted using localised format (comma decimal separator) for each
While working on
MDL-73824 it has been detected that reportbuilder not always observe current separators (decimal, thousands...) when printing floats (specifically percentages, because there was a behat test failing with decsep set to comma and, still, the test was printing dots (.).
If you want too see how to bulk-upgrade all behat tests to run using another decsep, take a look to
MDL-73824. Alternatively, it can be set for an scenario with:
The failing scenario when running all tests with comma decsep is:
And, instead of the expected 66,7% (comma), a 66.7% (dot) is output.
In this exact case the fix is easy and I got it passing with this easy change:
But, instead of fixing that as part of
MDL-73824 , I think this case deserves a must-fix issue per se, so it can be reviewed if there are other places where the localised floats are not working (I've seen, at very least, another suspicious sprintf() in the code.
So this is about:
- Review all the places where reportbuilder can be using floats for user input or output (not for exporting files, it seems to be a consensus about always using English dots there). Fix them using PARAM_LOCALISEDFLOAT or unformat_float() for inputs and format_float() for outputs.
- If possible, add some extra examples, also changing the decimal separator (to comma, to hash...) and verify that all the places working with floats, continue working ok.