Topic on Extension talk:FormatNum

Jump to navigation Jump to search

decimal comma system into en. decimal point

9
Pinky sl (talkcontribs)

Can you tell me the result of this usage before we install this extension on slovenian wikipedia:

{{#formatnum: 2300,123|2|,|.}} gives result: 2,300.12 or 2300.12
{{#formatnum: 2300|2|,|.}} gives result: 2,300 or 2300
{{#formatnum: 1.234.567,89|2|,|.}} gives result: ?, it should be 1234567.89 or 1,234,567.89

The problem was that we want that parameters in our infoboxes contains input decimal comma system and we must prepare the number for further calculations in engish decimal point system.

DaSch (talkcontribs)
Pinky sl (talkcontribs)
DaSch (talkcontribs)

the problem is, that when using . as seperator for thousands this is recogniced as decimal seperator because of this I added another parameter so that you can specify the sepeator for thousands so that it can be removed

DaSch (talkcontribs)

I added some lines so that the seperator will be guessed. this will only work if it's clear which one is the thousand sepeator and which the decimal seperator

Pinky sl (talkcontribs)

Its better, but still:

{{#formatnum: 2.300|2|.|}} → 2.30 it should be 2300.12
{{#formatnum: 10.000|2|.|}} → 10.00 it should be 10000.00
DaSch (talkcontribs)

how can the parser know, that the point is a thousend seperator and not a decimal seperator? when adding otsep=. you will get the behaviour you want. Then the parser know that the . is a thousand seperator.

Pinky sl (talkcontribs)

Thanks. It works fine for me (or I should say slovenian wikipedians) and I will recomend this Extension for installation. This will have a large improvement in our templates (calculating population density, all sorts of conversions). We still have to do some voting about this, but I dont see any problems. Are all changes you made in the latest version - 0.5.1 (2012-08-27)?

And I am sorry about my dummy questions, I am new in Media wiki (till now I was just Media wiki user).

DaSch (talkcontribs)

There are no new changes. The latest version 0.5.1 contains all you can test on the Web Community Wiki.

No problem, I liked to help.

Reply to "decimal comma system into en. decimal point"