If I'm inputting a number in string format using JOptionPane.showInputDialog, how do I convert the string I inputted to a double?

String rate;
double hrRate;

rate= JOptionPane.showInputDialog("Input hourly rate");