How do I handle this division equation on the Propeller?
Don M
Posts: 1,652
Lets say I have a counter counting up seconds. When I'm ready to display the elapsed time I want to display anything over 60 seconds as minutes & seconds.
So if I have a total seconds of say 125. So lets assign a long variable named time that adds up all the seconds.
So I know that minutes = 2 since the Prop doesn't deal with less than whole numbers but how do I get the .083 to convert back into seconds?
Thanks.
Don
So if I have a total seconds of say 125. So lets assign a long variable named time that adds up all the seconds.
time := time + seconds ' time = 125 minutes := time / 60 ' answer is 2.083
So I know that minutes = 2 since the Prop doesn't deal with less than whole numbers but how do I get the .083 to convert back into seconds?
Thanks.
Don
Comments
-Phil
I convert seconds to HH:MM:SS format like this: