Basically my program is supposed to show hours worked, minutes leftover and weekly pay after a user enters total minutes worked and hourly pay rate into the text boxes.
I am able to get it so that in my labels it shows hours worked with another label that shows left over minutes using the division operator "\" for hours worked followed by the "Mod" operator to get the leftover minutes.
I'm having a logic problem calculating weekly pay. It's able to do it great with just an even hour number but I can't seem to have it figure out the additional pay with the leftover minutes it just multiplies it all together and get a giant number which is wrong.
Here is the code:
Dim strHoursWorked As String
Dim intHoursWorked As Integer
Dim strMinutesLeftover As String
Dim decMinutesLeftover As Decimal
Dim strPayRate As String
Dim decPayRate As Decimal
strHoursWorked = Me.txtMins.Text
intHoursWorked = Convert.ToInt32(strHoursWorked)
strMinutesLeftover = Me.txtMins.Text
decMinutesLeftover = Convert.ToDecimal(strMinutesLeftover)
strPayRate = Me.txtHourlyRate.Text
decPayRate = Convert.ToDecimal(strPayRate)
Me.lblHours.Text = intHoursWorked \ 60
Me.lblMinutes.Text = decMinutesLeftover Mod 60
help here >>Me.lblDollars.Text =
I am able to get it so that in my labels it shows hours worked with another label that shows left over minutes using the division operator "\" for hours worked followed by the "Mod" operator to get the leftover minutes.
I'm having a logic problem calculating weekly pay. It's able to do it great with just an even hour number but I can't seem to have it figure out the additional pay with the leftover minutes it just multiplies it all together and get a giant number which is wrong.
Here is the code:
Dim strHoursWorked As String
Dim intHoursWorked As Integer
Dim strMinutesLeftover As String
Dim decMinutesLeftover As Decimal
Dim strPayRate As String
Dim decPayRate As Decimal
strHoursWorked = Me.txtMins.Text
intHoursWorked = Convert.ToInt32(strHoursWorked)
strMinutesLeftover = Me.txtMins.Text
decMinutesLeftover = Convert.ToDecimal(strMinutesLeftover)
strPayRate = Me.txtHourlyRate.Text
decPayRate = Convert.ToDecimal(strPayRate)
Me.lblHours.Text = intHoursWorked \ 60
Me.lblMinutes.Text = decMinutesLeftover Mod 60
help here >>Me.lblDollars.Text =