In this case it is important to have an appropriate value that is transformed by the defined pattern that in this case is "##.###.###,##"
otherwise you will have a IllegalArgumentException
that can be a cause of the closure of your application.
Another reason is that if you are converting to Double, firstly ensure that the String value to be converted into a numerical one, otherwise you would have error NumberFormatException
.
You comment that the value of TRANSACCION_MONTO
is "150000", and you want to show "150,000.00", for this the correct pattern to apply the format should be "###, ###. 00"
Example:
String convertedString = new DecimalFormat("###,###.00")
.format(Double.parseDouble(TRANSACCION_MONTO));
This way, convertedString will have a value:
150,000.00