Commits

Marc-Alexandre Chan committed df9303e

Fixing floating-point imprecision in time formatting

WordWar minor change in init - don't call time.time() again

  • Participants
  • Parent commits 3ec707e
  • Branches dev

Comments (0)

Files changed (2)

Plugins/writing/WordWarfareFiles/WordWar.py

 
         # initialise instance
         self.setDuration(duration)
-        self.startAt(time.time() + delay)
+        self.startAt(self.declareTime() + delay)
         self.setSignWait(signTime)
 
         self._cb_func(self, self.CB_DECLARED)

Plugins/writing/WordWarfareFiles/utils.py

         return None
 
     time_div = 0
-    time_rem = time
+    time_rem = round(time) # avoid problem floats being slightly below int value
     timestr_pieces = []
     unitvals = [("w", 604800), ("d", 86400), ("h", 3600), ("min", 60), ("s", 1)]
     plurunits = { "w"  : u"weeks",   "d"  : u"days"  , "h": u"hours",