From 7f22fb6bb6d9967cbd4df18272ba4c0f31c4f0ae Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Wed, 23 Dec 2020 13:52:59 +0000 Subject: [PATCH] Upload files to 'UI' --- UI/UI_math.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/UI/UI_math.py b/UI/UI_math.py index 89f3fab..fddffc2 100644 --- a/UI/UI_math.py +++ b/UI/UI_math.py @@ -134,4 +134,48 @@ def filter_arrows(win): tmp.append(i) win.story["arrows"] = tmp +def timestring(tleft): + # This crazy function will convert the microsecond into something a bit + # more usefull. Like 03:20:90.06 Kind a thing. + + tleftX = tleft + + tleft = int(tleftX) + + addend = tleftX - tleft + + + valt = str(tleft) + + if tleft > 60 : + le = tleft + tleft = int(tleft / 60) + le = le - int(tleft * 60) + + stleft = "0"*(2-len(str(tleft)))+str(tleft) + sle = "0"*(2-len(str(le)))+str(le) + + valt = stleft+":"+ sle + + if tleft > 60 : + lele = le + le = tleft + tleft = int(tleft / 60) + le = le - int(tleft * 60) + lele = (lele - le) + if lele < 0: + lele = int(lele * -1) + + stleft = "0"*(2-len(str(tleft)))+str(tleft) + sle = "0"*(2-len(str(le)))+str(le) + slele = "0"*(2-len(str(lele)))+str(lele) + + valt = stleft+":"+ sle + ":" + slele + + if tleft > 24 : + le = tleft + tleft = int(tleft / 24) + le = le - int(tleft * 24) + valt = str(tleft)+" DAYS AND "+ str(le) + " HRS" + return valt + "." + str(int(addend*100))