0
다음 코드에서는 양수 만 허용하려고합니다.com.ibm.icu.text.DecimalFormat은 항상 ParseException을 던집니다.
DecimalFormat dfNoNegative = new DecimalFormat("#,##0.00");
dfNoNegative.setNegativePrefix("");
try {
System.out.println(dfNoNegative.parse("123.00"));
} catch (ParseException e) {
System.out.println(e.getMessage());
System.out.println(e.getErrorOffset());
e.printStackTrace();
}
오류 메시지와 ErrorOffset : 내가 잘못 오전 곳
이Unparseable number: "123.00"
6
사람이 나를 인도 할 수있는 몇 가지 내가 제대로 문자열을 구문 분석도 할 수없는 나는 이유? 작동하는 문자열에 대한 예제도 좋을 것입니다.