We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc76d51 commit 0a40544Copy full SHA for 0a40544
pendulum/duration.py
@@ -79,7 +79,8 @@ def __new__(
79
if total < 0:
80
m = -1
81
82
- self._microseconds = round(total % m * 1e6)
+ # round returns a float in python2, so ensure stored as an int
83
+ self._microseconds = int(round(total % m * 1e6))
84
self._seconds = abs(int(total)) % SECONDS_PER_DAY * m
85
86
_days = abs(int(total)) // SECONDS_PER_DAY * m
@@ -275,7 +276,7 @@ def to_iso8601_string(self):
275
276
# no division to avoid possible floating point errors
277
if not s:
278
s = "0"
- s += ".{:0>6}".format(self.microseconds).rstrip("0")
279
+ s += ".{:0>6d}".format(self.microseconds).rstrip("0")
280
if s:
281
time += "{}S".format(s)
282
if len(time) > 1:
0 commit comments