NumberFormat parse not strict enough

后端 未结 2 1614
囚心锁ツ
囚心锁ツ 2021-01-18 01:27

I have a JFormattedTextField with a NumberFormat with Locale.US. So the decimal separator is the point and the grouping separator is the comma.

2条回答
  •  难免孤独
    2021-01-18 02:21

    Actually, Number is just a super class for Double, so you could use Double.parseDouble(...) and then auto-unboxing should do the rest.

提交回复
热议问题