fixed for loop for total hours

I fixed the loop but….. JavaScript is treated array items like a string
so I had to recast it