Please change period to comma in parser function results for Latvian Wikipedia. For example in this result
{{#expr: 1/6 round 5 }} -> 0.16667
Community consensus (section "Punkta maiņa uz komatu").
Please change period to comma in parser function results for Latvian Wikipedia. For example in this result
{{#expr: 1/6 round 5 }} -> 0.16667
Community consensus (section "Punkta maiņa uz komatu").
{{formatnum:{{#expr: 1/6 round 5 }}}} -> 0,16667
Parser functions return standard numbers, and you can then format them in the locale of the wiki. Here the Latvian Wikipedia (and also in MediaWiki core) has a comma for the decimal separator and a (non-breakable) space for the 1000: 1 000 000,16667
S*, it works :)
But wouldn't it be possible to change point to comma to parser functions? Because now we (Latvian Wikipedia community) would have to go through all Wikipedia and fix it.
This therefore becomes a core number formatting bug, nothing ParserFunctions specific - an override of the commafy function I believe
It should need something like they have in Spanish https://github.com/wikimedia/mediawiki/blob/master/languages/classes/LanguageEs.php
As mentioned above, you can already get the desired result using formatnum:
{{formatnum: {{#expr: 1/6 round 5 }}}} → 0,16667
Mathematical parser functions only accept unformatted numbers as input (no thousands separator and '.' as decimal separator) and only produce unformatted numbers as output, and this can't be changed, as it would break existing templates.