Convert double to string to double

Could you explain more? I have user entered floating point numbers that I need to save as text. In other words, if the user entered: “1,345.6700” in the United States, I need to convert the number to 1345.67 to process. However, if my app is closed, I have to save and restore exactly what they entered and not restore it to “1345.67”.

If they enter “1.234.56”, I convert that to NaN but still restore “1.234.56”

Is DecimalFormat from Java what I want to use? It is unclear if DecimalFormat converts both to and from strings/doubles.

Thanks