I already answered this question about "Eastern Arabic Numerals", but Persian variant is a bit different, as described here:
http://en.wikipedia.org/wiki/Eastern_Arabic_numerals[
^].
So the implementation could be a bit more complex but the idea is basically the same.
So, please see my past solution for Eastern Arabic:
Arabic number problem in asp.net[
^].
My code is similar to your
ToFarsi
, just check it up.
You may need to fix this implementation to fix the Persian numerals. I could not figure out the mapping between Unicode code points and Persian variant of numerals, but it's possible that the mapping is not just the shift (ordering can be non-linear). Please use
http://unicode.org/[
^] to find out.
—SA