Last modified: 2012-10-20 17:15:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42386, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40386 - Installation of FormatNum on sl.wiki
Installation of FormatNum on sl.wiki
Status: RESOLVED INVALID
Product: Wikimedia
Classification: Unclassified
Extension setup (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
Depends on: 40422
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-20 11:48 UTC by Mihael Simonič
Modified: 2012-10-20 17:15 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mihael Simonič 2012-09-20 11:48:36 UTC
Could you please enable the FormatNum extension on sl.wikipedia.org?

Unlike English, our language uses commas as decimal mark, which is the main reason we need the extension.

The community agrees on installation; you can find the voting here: http://sl.wikipedia.org/wiki/Wikipedija:Glasovanja/In%C5%A1talacija_Extension:FormatNum

Best regards,
Mihael
Comment 1 Alex Monk 2012-09-20 15:48:58 UTC
This extension will need review before deployment. fawiki also want it (bug 32311)
Comment 2 Robin Pepermans (SPQRobin) 2012-09-24 16:26:18 UTC
If comma vs. decimal is the only reason, then the extension shouldn't be needed because commas and decimals are already marked correctly in MessagesSl.php ($separatorTransformTable). Though iirc formatnum does have some weird behaviour... But improvements to formatnum should go to core imho.
Comment 3 Platonides 2012-09-24 16:29:26 UTC
What should be the thousands separator for Slovenian?
Comment 4 Mihael Simonič 2012-10-12 17:06:18 UTC
A dot.

So for example one thousand five hundred forty three point five would be written as: 1.543,5
Comment 5 Sam Reed (reedy) 2012-10-12 17:10:07 UTC
(In reply to comment #2)
> If comma vs. decimal is the only reason, then the extension shouldn't be needed
> because commas and decimals are already marked correctly in MessagesSl.php
> ($separatorTransformTable). Though iirc formatnum does have some weird
> behaviour... But improvements to formatnum should go to core imho.

(In reply to comment #3)
> What should be the thousands separator for Slovenian?

(In reply to comment #4)
> A dot.
> 
> So for example one thousand five hundred forty three point five would be
> written as: 1.543,5

Fixing core localisation stuff should be done first
Comment 6 Platonides 2012-10-13 16:22:04 UTC
Sl localisation seems right (since 2010, abb2949d3e10412ea998dc06b39da7f545543c48). See http://sl.wikipedia.org/wiki/Uporabnik:Platonides/Bug_40386

So the requested extension is apparently not needed.
Comment 7 Vera 2012-10-14 13:25:17 UTC
If we want to use expr we must transform number into decimal dot system. Problem are numbers bigger than 1000 without thousand dot separator.

Use of extension {{#formatnum:number|number of decimals|decimal separator|thousand separator|old thousand separator}} or {{#formatnum:number|decs=number of decimals|dsep=decimal separator|tsep=thousand separator|otsep=old thousand separator|format=DIN or ISO|mint=minimal number to seperate thousands}} works fine for us (you can check this in http://www.wecowi.de/index.php?title=WeCoWi:Spielwiese)
{{#formatnum: 2300,123|2|.||otsep=.}} → 2300.12
{{#formatnum: 2300|2|.||otsep=.}} → 2300.00
{{#formatnum: 2.300|2|.||otsep=.}} → 2300.00 
{{#formatnum: 1.234.567,89|2|.||otsep=.}} → 1234567.89 
{{#formatnum: 6,0|2|.||otsep=.}} → 6.00
{{#formatnum: 6,1|2|.||otsep=.}} → 6.10 
{{#formatnum: 5|2|.||otsep=.}} → 5.00
{{#formatnum: 10000|2|.||otsep=.}} → 10000.00
{{#formatnum: 10.000|2|.||otsep=.}} → 10000.00 
{{#expr: {{#formatnum:10000|2|.||otsep=.}}/{{#formatnum:10|2|.||otsep=.}}}} → 1000
{{#expr: {{#formatnum:6,0|2|.||otsep=.}}/{{#formatnum:2,5|2|.||otsep=.}}}} → 2.4 

Current use of formatnum on sl wiki (decimal comma and thousands dot separator):
*{{formatnum: 2300,123}} → 2.300.123 (????)
*{{formatnum: 2300}} → 2.300  (????)
*{{formatnum: 2.300}} → 2,300 (ok)
*{{formatnum: 1.234.567,89}} → 1,234,567.89 (ok)
*{{formatnum: 6,0}} → 6.0 (ok)
*{{formatnum: 6,1}} → 6.1 (ok)
*{{formatnum: 5}} → 5  (ok)
*{{formatnum: 10000}} → 10.000 (????)
*{{formatnum: 10.000}} → 10,000 (ok)
*{{#expr: {{formatnum:10000}}/{{formatnum:10}}}} → 1   (????)
*{{#expr: {{formatnum:6,0}}/{{formatnum:2,5}}}} → 2.4  (ok)

After calculation we must transform the calculated number back into decimal comma system:
*formatnum:{{#expr: {{formatnum:6,0}}/{{formatnum:2,5}}}} result: 2,4
*formatnum:{{#expr: {{formatnum:5}}/{{formatnum:2}}}} result: 2,5
*formatnum:{{#expr: {{formatnum:10000}}/{{formatnum:10}}}} result: 1 (????)

If there is any other simple solution for our calculation problems instead of FormatNum extension ..... for now I just want to calculate population density.
Comment 8 Platonides 2012-10-14 14:42:12 UTC
You are trying to indifferently use formatnum: for two different functions

If you want to convert to Slovenian notation use:
{{formatnum: <number>}}

If you want to convert from Slovenian to make operations use:
{{formatnum: <number>|R}}


{{formatnum:{{#expr: {{formatnum:6,0|}}/{{formatnum:2,5|R}} }} }}  result: 2,4
{{formatnum:{{#expr: {{formatnum:5|R}}/{{formatnum:2|R}} }} }} result: 2,5
{{formatnum:{{#expr: {{formatnum:10000|R}}/{{formatnum:10|R}} }} }} result: 1.000 


Use of {{formatnum: <number> }} to convert from Slovenian to English notation will apparently work (as it will just be interchanging , and .) but trying to use that for matematics will fail with numbers greater than 10³ (the thousands separator will get into the way).
Comment 9 Vera 2012-10-20 17:15:17 UTC
Well I missed this R thing. I guess that solves my problem. There is no expert on parser functions in our Wikipedia and I am trying to do my best ... so ... thank you for helping me. I will try now to update our settlement infoboxes.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links