I am trying to write an application to convert bytes to kb to mb to gb to tb. Here\'s what I have so far:
def size_format(b): if b < 1000: r
Do float(b) before do dividing, e.g. do float(b)/1000 instead of float(b/1000), because both b and 1000 are integers, b/1000 is still an integer without decimal part.
float(b)/1000
float(b/1000)
b
b/1000