May 11, 2005 #1 jonmohr IS-IT--Management Sep 15, 2004 118 US I need to be able to create a decimal to time. For example: 1.5 minutes to 1:30 Thanks in advance!!!
May 11, 2005 #2 synapsevampire Programmer Mar 23, 2002 20,180 US Your display is NOT a time, it is a string of minutes and seconds, a time has hours. I would suggest converting it to seconds: Try: whileprintingrecords; numbervar DecTime:={table.field}; numberVar dur := Totalsecs:=(DecTime*60); numberVar hrs; numberVar min; numberVar sec; stringVar hhmmss; hrs := Truncate(Truncate(dur/60)/60); min := Remainder(Truncate(dur/60),60); sec := Remainder(dur,60); hhmmss := totext(hrs, "0") + ":" + totext(min, "00") + ":" + totext(sec, "00"); hhmmss -k Upvote 0 Downvote
Your display is NOT a time, it is a string of minutes and seconds, a time has hours. I would suggest converting it to seconds: Try: whileprintingrecords; numbervar DecTime:={table.field}; numberVar dur := Totalsecs:=(DecTime*60); numberVar hrs; numberVar min; numberVar sec; stringVar hhmmss; hrs := Truncate(Truncate(dur/60)/60); min := Remainder(Truncate(dur/60),60); sec := Remainder(dur,60); hhmmss := totext(hrs, "0") + ":" + totext(min, "00") + ":" + totext(sec, "00"); hhmmss -k
May 11, 2005 #3 synapsevampire Programmer Mar 23, 2002 20,180 US Sorry, (Irealized that my copty paste screwed up: whileprintingrecords; numbervar DecTime:=1.5; numbervar Totalsecs:=(DecTime*60); numberVar dur := Totalsecs numberVar hrs; numberVar min; numberVar sec; stringVar hhmmss; hrs := Truncate(Truncate(dur/60)/60); min := Remainder(Truncate(dur/60),60); sec := Remainder(dur,60); hhmmss := totext(hrs, "0") + ":" + totext(min, "00") + ":" + totext(sec, "00"); hhmmss -k Upvote 0 Downvote
Sorry, (Irealized that my copty paste screwed up: whileprintingrecords; numbervar DecTime:=1.5; numbervar Totalsecs:=(DecTime*60); numberVar dur := Totalsecs numberVar hrs; numberVar min; numberVar sec; stringVar hhmmss; hrs := Truncate(Truncate(dur/60)/60); min := Remainder(Truncate(dur/60),60); sec := Remainder(dur,60); hhmmss := totext(hrs, "0") + ":" + totext(min, "00") + ":" + totext(sec, "00"); hhmmss -k