Arabic Numerals in page

Arabic Numerals in page

  

how to display Arabic Numerals instead of English ones in the page?

I'm having a report on which I have both Arabic and English numerals side-by-side and I need to diaply both. is there a way to do this?

Solution

Hi Mohamed,

Have you thought about calling javascript code to translate the numeral? I've found this piece of code that should make the conversion:

function EnglishToArabicNumerals(numberString) {
 var arabicNumers= ['?','?','?','?','?','?','?','?','?','?'];
 return numberString.replace(/[0-9]/g, function(w){
  return arabicNumers[+w];
 });
}

Does it work?

Regards,

António Pereira

Solution

António Pereira wrote:

Hi Mohamed,

Have you thought about calling javascript code to translate the numeral? I've found this piece of code that should make the conversion:

function EnglishToArabicNumerals(numberString) {
 var arabicNumers= ['?','?','?','?','?','?','?','?','?','?'];
 return numberString.replace(/[0-9]/g, function(w){
  return arabicNumers[+w];
 });
}

Does it work?

Regards,

António Pereira

Thank you António

I tried the same idea on a server action and it worked perfectly. thank you for the swift response.

here it is for others references

SyntaxEditor Code Snippet

Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(OriginalText,"0","?"),"9","?"),"8","?"),"7","?"),"6","?"),"5","?"),"4","?"),"3","?"),"2","?"),"1","?")

Hi!


On a past project I had the need to have this and I created a simple C# extension. It support converting to and from Arabic numerals.


Here you have it, in case it fits your needs

João Batista wrote:

Hi!


On a past project I had the need to have this and I created a simple C# extension. It support converting to and from Arabic numerals.


Here you have it, in case it fits your needs

Thank you João, I will give this a try.