Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Chart
I am using microsoft chart and it works great but i dont want show numbers in english mode,
I need to show numbers in 1256 char-set;
 
any help would be greatly appreciated.
Posted 31-Dec-11 23:45pm
Comments
SAKryukov at 1-Jan-12 10:30am
   
What exactly do you want to show? If you see my answer you can understand what do I mean.
Happy New Year!
--SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Where have you been? Even though 1256 charset would work in HTML page, it has been replaced with Unicode, which can be used to support nearly all languages in one text. ASP.NET supports Unicode; using anything else would be quite awkward; I don't even want to discuss it.
 
Now, do you mean Arabic digits? There are two different meanings in Arabic digits. Commonly used digits '0' to '9' are also called "Arabic" because they have been introduced in Europe by Arabs in X century. If you mean older form of Arabic numerals (٠‎ - ١‎ - ٢‎ - ٣‎ - ٤‎ - ٥‎ - ٦‎ - ٧‎ - ٨‎ - ٩), code points U+0660 to U+0669. This is a different system called "Eastern Arabic Numerals".
 
See:
http://en.wikipedia.org/wiki/Hindu%E2%80%93Arabic_numeral_system[^],
http://en.wikipedia.org/wiki/Eastern_Arabic_numerals[^].
 
[EDIT]
Please pay attention: you can also use Persian variant of Eastern Arabic numerals, with each digit using different Unicode code point, even for digit glyphs looking identical. Please see the second link above.
[END EDIT]
 
To find any code point, you can use the "Character Map" application bundled with all versions of Windows, charmap.exe.
 
Now, I'm afraid that if you want to use Eastern Arabic system, you will have to replace the digits by your own code. As far as I understand, in Arabic countries both systems are used, and the use of '0'-'9' is the default. As I learned from the other CodeProject questions, the methods of numeric types ToString(IFormatProvider) will return a string with '0'-'9' digits even if Arabic culture is used as the argument.
 
For thee usage of IFormatProvider, use the class System.Globalization.CultureInfo which implements this interface.
 
See http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx[^].
 
For example of the usage of ToString(IFormatProvider) (with culture) see, for example System.Int32.ToString with code sample:
http://msdn.microsoft.com/en-us/library/cht2hdff.aspx[^].
 
You certainly need to understand how Unicode works. See:
 
http://en.wikipedia.org/wiki/Unicode[^],
http://unicode.org/[^],
http://unicode.org/faq/utf_bom.html[^].
 
—SA
  Permalink  
v2
Comments
Espen Harlinn at 1-Jan-12 10:30am
   
my 5
SAKryukov at 1-Jan-12 10:34am
   
Thank you, Espen.
--SA
sjms at 2-Jan-12 5:28am
   
thanks for answring me.
I've been reading and testing whatever you posted.
what i wanted was exactly what you said.
now I've got this :
CultureInfo faCulture = CultureInfo.CreateSpecificCulture("fa-Ir");
faCulture.NumberFormat.DigitSubstitution = DigitShapes.NativeNational
"21".ToString(faCalture) // the output : 21
what i expect is : ٢‎١‎
what should I have wrote.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 275
1 Maciej Los 230
2 Sergey Alexandrovich Kryukov 185
3 Afzaal Ahmad Zeeshan 152
4 ProgramFOX 130
0 OriginalGriff 6,524
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,218
3 Manas Bhardwaj 4,657
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 1 Jan 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100