版权声明:独学而无友,则孤陋寡闻。q群582951247 https://blog.csdn.net/mp624183768/article/details/84892999
def covertFukeSize(size):
kb=1024;
mb=kb*1024;
gb=mb*1024;
tb=gb*1024;
if size>=tb:
return "%.1f TB"% float(size / tb)
if size>=gb:
return "%.1f GB"% float(size / gb)
if size>=mb:
return "%.1f MB"% float(size / mb)
if size>=kb:
return "%.1f KB"% float(size / kb)