mirror of
https://github.com/KevinMidboe/homeChecker.git
synced 2025-10-29 01:20:27 +00:00
More changes to formatting of decimals
This commit is contained in:
@@ -39,7 +39,7 @@ def getTimes():
|
||||
return returnList
|
||||
|
||||
def convertTime(seconds):
|
||||
delta = time() - seconds
|
||||
delta = float("%0.2f" % (time() - seconds))
|
||||
if delta >= 86400:
|
||||
return str(delta//86400) + ' days'
|
||||
elif delta >= 3600:
|
||||
@@ -65,7 +65,7 @@ def updateTimes():
|
||||
online = list(set(getOnlineClients()) & set(getAddr(c)))
|
||||
|
||||
for adr in online:
|
||||
c.execute('UPDATE lastonline SET timesince='+ str("{:10.2f}".format(curTime)) +' WHERE clientadr="'+ adr + '"')
|
||||
c.execute('UPDATE lastonline SET timesince='+ "%0.2f" % curTime +' WHERE clientadr="'+ adr + '"')
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
@@ -82,3 +82,4 @@ if __name__ == '__main__':
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user