Last modified: 2011-03-13 18:06:13 UTC
Hi I am trying to use a parser function {{#expr but it works only for english numbers. is there a way we can add functionality to do calculation with marathi numbers i.e. १ २ ३ ४ ...... is this possible. thanks Subhash
Actually, if this is going to be possible, I propose this to be generalize to all other scripts such as Arabic, Hebrew, Persian, Chinese, etc.
Yes, this is much needed enhancement. If we can get this working, it will be helpful in creating various complex templates in all devanagari language wikipedias (or in the wikis which use numbers other than english). Best regards, Kaustubh
I recently added {{formatnum:...|R}} in r32012 which accepts numbers in format that formatnum produces (depending on the language!) and formats them suitable for math. It may or may not be suitable solution for this.
Correct me if I'm wrong, but {{formatnum:...|R}} doesn't help here. For example, {{formatnum:۱۹۷۸|R}} doesn't return 1978 (the English writing of the same number writtenin Arabic), and can't be helpful in this case.
There are a couple of basic issues. Some are easy, some aren't. In theory, it should be very easy to automatically translate non-ASCII decimal digit characters; as long as they're clean decimal digits, that's a simple matter of having a list of known Unicode digits. Dealing with place and decimal separators that might be embedded in those numbers is more likely to be a problem.
(In reply to comment #5) > > Dealing with place and decimal separators that might be embedded in those > numbers is more likely to be a problem. > Not if a find and replace using $digitTransformTable takes place?
Whose digitTransformTable? What does 100,000 mean, without context? What does 100.000 mean, without context?
(In reply to comment #7) > Whose digitTransformTable? What does 100,000 mean, without context? What does > 100.000 mean, without context? > I was under the impression that the digitTransformTable for the "content" language of the wiki would be used.. (In reply to comment #4) > Correct me if I'm wrong, but {{formatnum:...|R}} doesn't help here. For > example, {{formatnum:۱۹۷۸|R}} doesn't return 1978 (the English writing of > the same number writtenin Arabic), and can't be helpful in this case. > I was wrong. It works as desired.
{{formatnum:...|R}} has been widely used to tackle this problem for more than a year now. In the existence of that workaround, I'm marking this bug as WONTFIX.