Hi folks,
My problem is that I have a user input field, which is a textfield, and I have to convert it to a bigDecimal for use at the database.
input:
2,50 -----> 2,50
2.50 -----> 2,50
2.5 -----> 2,50
1200 -----> 1200 (or 1200,00)
1.200 -----> 1200 (or 1200,00)
1.200,50 ------> 1200,50
1,200.50 ------> 1200,50
etc.
Is there a simple way to convert all these kind of inputs? The use of valueOf or parseDouble does not do the job. I also tried the DecimalFormatter, but I can't find the correct format.
Any help is appriciated.