math - Calculating wage by hours worked -


Oh all, I am trying to explain how to calculate wages for an employee, The code that I am using is:

The date given to date on the date as a startup date in the form of a static time as the total time string theStartTime = "16:11:06" End time = "18:22:01" total time = format (CDBL (end time - the starttime) * 24), "# 0.0")

will be practical hours: 2 F 11 M

Now, count up with my code, I get 2.2. What do I need to include to calculate the exact time of 2: 2 instead of 2:20?

David

note that 2.2 hours not 2 : 20, it's 2:12.

Change

  format (CDBL (end time - the starttime) * 24), "# 0.0")  

to

  format (end time - the starttime, "h: mm")  

You are getting the right price, when you print, you can turn it off There is a time duration equal to the difference between theEndTime - theStartTime as you found, by multiplying 24, you will be given a different number of hours. However, you will have to use date / time formatting again again 24 times.

Check all the methods.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -