Change DecimalFormat locale

前端 未结 6 1224
面向向阳花
面向向阳花 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 07:55

    You can also specify locale for DecimalFormat this way:

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

提交回复
热议问题