I'm doing small problems like practice for the course I'm following from Java.
I want when I enter two results, such as:
50,000 and 20,000 the result you get is 30,000 and not 30.0
On the contrary when I write 50,000 and 42,521 the result if it is complete
Thanks
CODE
import javax.swing.JOptionPane;
public class Supermercado {
public static void main (String [] args) {
String pago = JOptionPane.showInputDialog("Ingrese el monto pagado por el cliente");
double pago2 = Double.parseDouble(pago);
String precio = JOptionPane.showInputDialog("Ingrese el valor del producto");
double precio2 = Double.parseDouble(precio);
double cambio = pago2 - precio2;
JOptionPane.showMessageDialog(null,"El cambio es igual a " + cambio);
}
}