DecimalFormat.format
accepts only Date
or Number
objects, not String
!
EDIT-1:
1) String pattern = "00.00"
2)
String result1 = formatter.format(formatter.parse(test1));
String result2 = formatter.format(formatter.parse(test2));
String result3 = formatter.format(formatter.parse(test3));
For example: for
final String test1 = new String("01,");
final String test2 = new String("02,3");
final String test3 = new String("1,00");
it gives me:
Result 1 == 01,00
Result 2 == 02,30
Result 3 == 01,00