I want to make sure that I understand how to change characters (mainly "." into "," and vice versa).
So I wrote a program, but I can't type in a decimal number. What should I do?
import java.text.DecimalFormat;
import javax.swing.*;
public class decimalFormat {
public static void main(String[]args) {
DecimalFormat df= new DecimalFormat("##,##0.00");
String s= JOptionPane.showInputDialog(null,"Please enter a number");
s= df.format(s);
double t=Double.parseDouble(s);
JOptionPane.showMessageDialog(null,"Your number rounded to two digits is");
}
}