Page MenuHomePhabricator

Change period to comma in parser function results in Latvian Wikipedia
Closed, DeclinedPublic

Description

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").

Event Timeline

Edgars2007 raised the priority of this task from to Needs Triage.
Edgars2007 updated the task description. (Show Details)
Edgars2007 subscribed.
Aklapper triaged this task as Medium priority.Apr 7 2015, 2:29 PM
Aklapper set Security to None.

{{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

matmarex subscribed.

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.