Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to convert numbers into arabic text using C#?

user-image
Question added by Noushad venkitta , Software Programmer , MNC
Date Posted: 2013/11/07
Haider Ali Chaudhry
by Haider Ali Chaudhry , Senior Software Engineer , Hexagon Safety & Infrastructure

public static string ConvertNumeralsToArabic(string input)

        {

            return input = input.Replace('0', '٠')

                        .Replace('1', '۱')

                        .Replace('2', '۲')

                        .Replace('3', '۳')

                        .Replace('4', '٤')

                        .Replace('5', '۵')

                        .Replace('6', '٦')

                        .Replace('7', '٧')

                        .Replace('8', '٨')

                        .Replace('9', '٩');

        }

 

// Call this where ever you want.

ConvertNumeralsToArabic(DateTime.Now.Date.ToString())

 

And if you want to convert to words, first u need to create a dictionary of that words, then you can replace by using arrays.

Noushad venkitta
by Noushad venkitta , Software Programmer , MNC

thanks for ur reply..but i need numbers into arabic words for example  (45000)خمسة و أربعون ألف  

Daanish Rumani
by Daanish Rumani , Product Manager , Publicis Sapient

var aNumber =;

var theNumberAsArabicString = string.Format(new CultureInfo("ar-AE"), "{0}", aNumber);

Console.WriteLine(string.format("The Number: {0} is represented in arabic as: {1}", aNumber, theNumberAsArabicString));

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.