How would I go about taking a percentage of 24 hours and converting it into an hour?
Basically, this is for a piece of code that I'm writing - and I need to calculate figures for every hour in the year.
So far, the total of hours in the year is 8760 (365 * 24). What I need to work out from this is what hour this would represent in a day.
For example, 8760 would be 24 (it's the 24th hour on the 365th day). 25 would be 1 (the first hour on the second day). 57 would be 4 (the 4th hour on the 3rd day).
I can work out the percentage of 24 hours by doing the following:
1 / 24 = 0.041666666666667
0.041666666666667 * 100
If I times the number after the decimal point by 100 - it gives me the percentage of 24 hours (I think!). I'm pretty much stuck at what to do with this number.
I hope I'm missing something obvious but what mathematical formula could I use to figure these numbers out reliably?
I hope I explained that well enough! Thanks!