Converting Decimals into Hours

linum

Active Member
Licensed User
How can I convert a decimal value into hours?

For example; I have 62.89 hours. How can I convert the .89 into minutes?




Thank you in advance...
 

linum

Active Member
Licensed User
Ok, I think 60 minutes times my decimal then divide by 100 will give me what I'm looking for:

B4X:
60 * .89 / 100 = 0.534

Now I just got to figure out how to easily have B4P read my decimal value, omit the 62, read from the period till the end of the value in order to apply the formula above.

Any ideas as to what would be easier?
 

linum

Active Member
Licensed User
Ok, I figured it out. I use strSplit to split my string at the period into two:

B4X:
word() = strSplit(decimal, ".")

Hope this helps others...
 

linum

Active Member
Licensed User
Thanks Erel. I had never read about the Int function in the manual before. This is definitely the easiest way to do it.


Thanks again...
 
Top