Last modified: 2014-04-17 10:32:05 UTC
== REPRODUCTION #1 == * Navigate to https://hi.wikipedia.org/w/index.php?title=Project:Sandbox&action=submit * Enter in the following wikitext: {{formatnum:-.123}} * Preview the wikitext. The following is produced: "-.1.123" * Compare this to https://en.wikipedia.org/w/index.php?title=Project:Sandbox&action=submit wherein {{formatnum:-.123}} generates "-.123" == REPRODUCTION #2 == * Similar to above, but enter in the following wikitext: {{formatnum:a123}} * On hi.wikipedia.org, it produces "a12" * On en.wikipedia.org, it produces "a123" == DETAILS == * The issue only affects languages which have the $digitGroupingPattern specified - MessagesAs.php - MessagesBn.php - MessagesGu.php - MessagesHi.php - MessagesKn.php - MessagesMl.php - MessagesMr.php - MessagesOr.php - MessagesPa.php - MessagesSa.php - MessagesTa.php - MessagesTe.php * The problem is in the commafy function in languages\Language.php * The lack of $digitGroupingPattern causes the function to enter the 2nd if branch which produces the bad output * Note that most languages don't specify $digitGroupingPattern (such as en) == OTHER == * Note the following extreme outlier: {{formatnum:1234a5678b2345c.3456d7890e3210.f5432}} * On hi.wikipedia.org, it produces "1,234.3456" ** commafy branch #2 takes the first "number" group, and then concatenates the first "decimal" group * On en.wikipedia.org, it produces "1,234a5,678b2,345c.3456d7,890e3,210.f5,432" ** commafy branch #1 goes through the entire string and formats non-decimal numbers * In theory both results should be consistent
Slight correction to the above: "The lack of $digitGroupingPattern" should be "The presence of $digitGroupingPattern"