Sorting it all Out Michael Kaplan's random stuff of dubious value Be sure to read the disclaimer here first!
Balsu asks:
HiIs there a way to parse the numbers of other digits in C#?After changing the culture to Tamil and Parsing like below didn’t solve the issueint y = Int32.Parse(“௩௲௭௱௮௰௨”, NumberStyles.Number, CultureInfo.CurrentCulture.NumberFormat);௩௲௭௱௮௰௨ is tamil equivalent of 3782.Thanks!Bala
Now, there are three responses that occur to me here.
The first is that there is no locale specific number parsing support in either managed or unmanaged code, though I have talked about digit substitution in both kind of code in the past almost obsessively at times. The pieces are in place for the future, but for now you'd have to either use the new NumberFormatInfo properties or call the unmanaged FoldString and just do the substitution yourself.
The second is that the form of Tamil being discussed is not to do with treating Tamil numbers as digits....
The third is that the older use of Tamil numbers (that I described in In Tamil -- sometimes, they are digits; other times, just numbers) is highly unlikely to really be added as a core supported mechnism here -- it is sdimply not commonly used at this point in time. Do if you want 3782 then ௩௭௮௨ is muh more likely to be what people would be expecting (though the algorithm would be easy enough to code up!).
The same thing probably applies to romn numerals, as well.
Ethiopic, on the other hand, may be put in the more commonly used category, and there is some indication that its usage in date and calendar formatting and as an option in number formatting might make sense (more info in Why that is positively Ethiopic!). But thus far other number systems just seem to be not so common these days....
This post brought to you by ௲ (U+0bf2, a.k.a. TAMIL NUMBER ONE THOUSAND)
I am pretty sure I have mentioned Chris Walker before on this blog .... Anyway, the other day after that
Boris asked me: Hi Michael. I saw the thread about parsing the numbers of other language digits, however
Now I have talked about the good, the bad, the ugly, the pretty, the ins, and the outs of digit substitution
Over the years I've had a lot to say about Digit Substitution , the feature so widely used in so many