web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to convert number(8893) to arabic number(????) in x++?

(0) ShareShare
ReportReport
Posted on by 516

Hi All,

if anyone has code to convert number(8893) to arabic number(٨٨٩٣) like in x++ ax 2012, Please provide me or please tell me how to do that.

Thanks in advance 

akshay

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi Akshay,

    please find the following method

     public string ConvertToEasternArabicNumerals(string input)
            {
                System.Text.UTF8Encoding utf8Encoder = new System.Text.UTF8Encoding();
                System.Text.Decoder utf8Decoder = utf8Encoder.GetDecoder();
                System.Text.StringBuilder convertedChars = new System.Text.StringBuilder();
                char[] convertedChar = new char[1];
                byte[] bytes = new byte[] { 217, 160 };
                char[] inputCharArray = input.ToCharArray();
                foreach (char c in inputCharArray)
                {
                    if (char.IsDigit(c))
                    {
                        bytes[1] = Convert.ToByte(160 + char.GetNumericValue(c));
                        utf8Decoder.GetChars(bytes, 0, 2, convertedChar, 0);
                        convertedChars.Append(convertedChar[0]);
                    }
                    else
                    {
                        convertedChars.Append(c);
                    }
                }
                return convertedChars.ToString();
            } 

  • akshaykupra Profile Picture
    516 on at

    Hi vinod,

    thank you for this code,

    but when i am running it giving me syntax error on

    char[] convertedChar = new char[1];

               byte[] bytes = new byte[] { 217, 160 };

               char[] inputCharArray = input.ToCharArray();

               foreach (char c in inputCharArray)

               {

    i have chenged, but still

    please  guide me thanks in advance

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans