Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use comma instead of dot as decimal seperator

807603Oct 25 2007 — edited Oct 26 2007
Hi,
In my application, there is a field "currency" and i had to ensure that the value entered in currency field is always "numeric". I did this by checking for "NumberFormatException" when the value is parsed.
This is not working when the currency is entered as 22,21 instead of 22.21, as is done in some countries,i.e, comma is used instead of dot, as seperator. Can someone please advise, how should i accept "22,21" in "currency" field with it's type remaining "numeric"
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2007
Added on Oct 25 2007
4 comments
1,253 views