-
Program help
Hey, everything in my program works except for this portion of code:
Code:
totalpayed = ( (mon + tue + wed + thu + fri + sat) * payrate );
sunpayed = sun * sunpayrate;
totalpayed += sunpayed;
I dont know why but the calculation always ends up wrong. Here's the rest of the code...
-
Is payrate an int, double, or float?
-
-
Hi,
You were using the same editbox for all the days.
I also prefer using sprintf above _gcvt as it is ANSI and _gcvt not
Code:
GetDlgItemText(hDlg, IDC_MON, monstr, 10);
GetDlgItemText(hDlg, IDC_MON, tuestr, 10);
GetDlgItemText(hDlg, IDC_MON, wedstr, 10);
GetDlgItemText(hDlg, IDC_MON, thustr, 10);
GetDlgItemText(hDlg, IDC_MON, fristr, 10);
GetDlgItemText(hDlg, IDC_MON, satstr, 10);
GetDlgItemText(hDlg, IDC_MON, sunstr, 10);
should change to
Code:
GetDlgItemText(hDlg, IDC_MON, monstr, 10);
GetDlgItemText(hDlg, IDC_TUE, tuestr, 10);
GetDlgItemText(hDlg, IDC_WED, wedstr, 10);
GetDlgItemText(hDlg, IDC_THU, thustr, 10);
GetDlgItemText(hDlg, IDC_FRI, fristr, 10);
GetDlgItemText(hDlg, IDC_SAT, satstr, 10);
GetDlgItemText(hDlg, IDC_SUN, sunstr, 10);
-
ah crap. Im so dumb. Ahh!!! I forgot to change them after I pasted them all.
Ok we have now extablished I am very dumb!