DecimalFormat parsing invalid formatted string with no issue

41 Views Asked by At
System.out.println(new DecimalFormat("###,###.##").parse("123123.33"));

System.out.println(new DecimalFormat("###,###.##").parse("123,123.33"));

Both return the same value: 123123.33. However, in the first case, I need to validate and return with fail.

0

There are 0 best solutions below