Parsing user input into numbers (especially numbers representing money) is a very common task. Such parsing is
often implemented with DecimalFormat.
However, parsing with DecimalFormat should be done with care.
You may even want to consider an alternative. Here's why:

surprisingly, a Format does not
need to parse all of its input. That is, if it finds a
match at the start of an input String, it will cease parsing, and return a value. When parsing user input, this
kind of behavior is not usually desired. To accomodate this behavior, an extra step is needed - a
ParsePosition object
needs to be passed as an output parameter to DecimalFormat.