Did you understand why you were getting a Numberformatexception? When you do a parseDouble...it takes a string so the compilation is ok. But during runtime when the number is actually converted, it doesn't get converted to a double because the the format of the number you have passed is not a double but rather a String because of the $.
[ SCJP 6.0 - 90% ] , JSP, Servlets and Learning EJB.
Try out the programs using a TextEditor. Textpad - Java 6 api