Move to python3 style division.
All of these are currently integer division in python2.
This commit is contained in:
parent
c8fbd2860d
commit
cbe1eefcf0
12 changed files with 18 additions and 9 deletions
|
|
@ -5,6 +5,7 @@ They provide some useful string and conversion methods that might
|
|||
be of use when designing your own game.
|
||||
|
||||
"""
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
|
|
@ -265,11 +266,11 @@ def time_format(seconds, style=0):
|
|||
# We'll just use integer math, no need for decimal precision.
|
||||
seconds = int(seconds)
|
||||
|
||||
days = seconds / 86400
|
||||
days = seconds // 86400
|
||||
seconds -= days * 86400
|
||||
hours = seconds / 3600
|
||||
hours = seconds // 3600
|
||||
seconds -= hours * 3600
|
||||
minutes = seconds / 60
|
||||
minutes = seconds // 60
|
||||
seconds -= minutes * 60
|
||||
|
||||
if style is 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue