On 01/31/2013 10:48 AM, Ad Strack van Schijndel wrote:
- #expr only accepts . as decimal separator and doesn't like thousands separators. So before you can do any calculation you have to transform the amounts that have been entered on forms in Dutch format.
It looks like there is a function, Language::parseFormattedNumber, that ParserFunctions could use to translate the input from the wiki's content language.
I asked the original author of the function (Niklas Laxström) about this and he said the function wasn't designed for user-input, is expecting something particular, and may produce unexpected output.
I think this is at least worth a bug report so I made one: http://bugzilla.wikimedia.org/44559
- #formatnum also only accepts English format as input, so if you want the plain 2500,5 that has been entered by the user to appear on the page as € 2.500,50 you have to transform twice. First transform to English format and then use #formatnum.
The Formatnum extension looks like it is designed to translate English format numbers to other formats, but you seem to make a good case that it, too, could use Language::parseFormattedNumber.
- Calculations can be rather complex with combinations of entered amounts, queried amounts and results of other calculations.
It sounds like you have some great test cases for any code changes that may be made. Would you be interested in collaborating on this?
Mark.