How can I format a String number to have commas in android Edit Field

后端 未结 8 1847
盖世英雄少女心
盖世英雄少女心 2020-12-07 18:27

For what function I can use in android to display the number into different formats.

For eg: If I enter 1000 then it should display like this 1,000. If I enter 1000

8条回答
  •  忘掉有多难
    2020-12-07 19:02

    try this one hope it will help.

     System.out.println(NumberFormat.getNumberInstance(Locale.US).format(1000));
    

提交回复
热议问题