Hi all,
Need some help I am writing a very small applet and stuck on somthing, I have tried everythink I can think off.I know it gonna be somthing silly but just cant work it out.
Code:
double x;
String total;
String newtotal;
try {
String xStr = txtAmount.getText();
x = Double.parseDouble(xStr);
}
catch (NumberFormatException e) {
// The string xStr is not a legal number.
txtAmount.setText("Illegal data for x.");
return;
}
total = ( "£" + (x*12));
txtYear.setText(total);
newtotal =((y/365) +"p");
txtDay.setText(newtotal);
Ok what happen there are 3 textboxes, the user inputs a price in the top one txtAmount.
This then times this by 12 to give a price for a year. I need this value to go into the next box what is txtYear this all works fine.
The bit I cant do is the next bit, I need to take the value from the txtYear and divide it by 365 and place the newtotal into txtday.
any help would be amazing as it really starting to p me off
thanks again
|