Move to python3 style division.

All of these are currently integer division in python2.
This commit is contained in:
Ahmed Charles 2015-10-19 05:26:10 +00:00
parent c8fbd2860d
commit cbe1eefcf0
12 changed files with 18 additions and 9 deletions

View file

@ -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: