Re: Converting interval to decimal ?
Posted in 1995
Santiago Albanese <75030.2743@CompuServe.COM> wrote: > Is there a way to convert an hour to minutes interval to >a decimal value for a report ? . I am running a 4gl prog that >reports hors worked in the interval form of ( 8:40 ) for eigth >hors and forty minutes and I want to display it as 8.66 hours . I >have worked a solution with awk but would prefer to do it with >4gl code . > > Thanks in advance , > Chago Following is a function (included in the Power-4gl toolset) which I believe solves your problem: ######################################################################### # Conversion of interval time period to decimal hour format. ######################################################################### function hourtime(i) define i interval minute(9) to minute, x char(10), d decimal let x = i let d = x let d = d / 60 return d end function