androidflutterdartcsedu

Converting Numbers to Local (UTF8) Bengali numbers


I am trying to convert the English numbers (1, 2, 3) to Bengali numbers (১, ২, ৩).

For example, if I get 10000, then I want to show like ১০,০০০.

I can replace the number one by one with the Bengali counterpart using replaceAll method

But I want to know if there is an alternative solution to do that instead of the above.


Solution

  • I have used NumberFormat from popular library Intl and converted it easily like below

    NumberFormat("##,##,##,###", "bn").format(10000)
    

    And the output is:

    ১০,০০০