Skip to main content

DecimalFormat silently ignores invalid characters?

No replies
navinkjha
Offline
Joined: 2004-12-28

It seems if you tell DecimalFormat to parse say "435k24.45" it will simply return 435. So it skip the part starting from the letter k. Is there a way to tell DecimalFormat to only accept say number, dot and comma? So numbers like 10, 50.00, 1,000.50 are accepted but when there is an invalid character it throws parse exception.