You may want to consider using NumberUtils at some point for this parsing.