converting string to percentage rate
Posted on 2006-05-16
I am coding a gui java program that takes users input and calculates mortgage amount. The program runs ok but i realized the rate was converting to Double.parseDouble which was causign the mortgage amounts to be way off the amount it should of been. I have to convert the rate to a percentage but when i changed the below section to percentFormat.parse(rate) it did not work. I receive error from compiler- MortgageGui1.java:58: cannot find symbol. How do you convert a string to a percentage rate?
rate = JOptionPane.showInputDialog(null,"Please enter annual finance rate:", " ", JOptionPane.QUESTION_MESSAGE);
rateValue = percentFormat.parse(rate);