Reputation: 3536
I'm working on an Arabic site and I need to support arabic locale for showing numbers. I tried using the arabic angular locale file but it does not entail changing the number from EN to AR.
For example, the number 120
in EN is ١٢٠
in AR. Is there way to get this angular? (and then do calculations).
Upvotes: 2
Views: 713
Reputation: 668
In case someone else is also looking into this now (2017), calling toLocaleString
on a number object should return the number string in the given locale.
let numbers = 1234567890;
console.log(numbers.toLocaleString('ar-EN'));
will log
١٬٢٣٤٬٥٦٧٬٨٩٠
Upvotes: 1
Reputation: 3536
I decided to go ahead with writing a custom filter that just displays the number in arabic. Thanks for the link @Samuel Neff.
Upvotes: 0