How to format the input of EditText when typing with thousands separators (,) in Android?

前端 未结 3 1045
春和景丽
春和景丽 2021-02-04 11:54

I\'ve an edittext , it only gets numeric without decimal numbers.

android:inputType=\"number\"

I want to separate thousands while

3条回答
  •  执笔经年
    2021-02-04 11:55

    DecimalFormat formatter = new DecimalFormat("#,###,###");
    String yourFormattedString = formatter.format(100000);
    

    Use DecimalFormat

提交回复
热议问题