sadsad_story
2012-10-06 10:36:12 UTC
do anyone know how to save float or double data type in textfield?
below is my coding to do calculation:
double userKeyin = Double.parseDouble(txtPay.getText());
double Total = Double.parseDouble(txtTotal.getText());
String Change = String.valueOf(userKeyin - Total);
jTextField1.setText(""+Change);
when i key in 60, 70, 80 to minus float data type, the output will be 000000003 or 9999999997 something like this...
anyone can help me pls.... :(
below is my coding to do calculation:
double userKeyin = Double.parseDouble(txtPay.getText());
double Total = Double.parseDouble(txtTotal.getText());
String Change = String.valueOf(userKeyin - Total);
jTextField1.setText(""+Change);
when i key in 60, 70, 80 to minus float data type, the output will be 000000003 or 9999999997 something like this...
anyone can help me pls.... :(