1

In Angular 8, i need to convert number text based on language selected. For example 123456789 number in US format 123,456,456 when converted to indian format it will be 12,34,56,456

It need to be dynamically change based on language selected.

It need to support any language or any currency.

  • 1
    Would this be what you're looking for: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat – K41F4r Jul 07 '20 at 14:56
  • Does this answer your question? [Displaying a number in Indian format using Javascript](https://stackoverflow.com/questions/16037165/displaying-a-number-in-indian-format-using-javascript) – Allan Cameron Jul 07 '20 at 15:38
  • 1
    @K41F4r thanks for the solution is there any option to convert back to orginal number. Thanks in advance – mahidhar reddy Jul 07 '20 at 16:50
  • You could save the original number separately and convert it to the requested language for display purposes when needed. You probably shouldn't modify the original number itself – K41F4r Jul 08 '20 at 04:13
  • In UI number is editable, if i change number in UI i don't know the updated number – mahidhar reddy Jul 08 '20 at 06:08

0 Answers0