Change DecimalFormat locale

前端 未结 6 1237
面向向阳花
面向向阳花 2020-12-14 07:02

I have custom DecimalFormat in Edittext\'s addTextChangedListener method, everything is working perfectly but when I change language (locale) my addTextChanged

6条回答
  •  时光取名叫无心
    2020-12-14 08:00

    You can use basic constructor for setting Locale while creating DecimalFormat object:

    DecimalFormat dFormat = new DecimalFormat("#.#", new DecimalFormatSymbols(Locale.US));
    

提交回复
热议问题