1 """Random helpful functions for mevemon """
6 """Converts a number in the format 1234567 to 1,234,567
8 num_string = '%0.2f' % number
10 #a,b = num_string.split('.')
11 decimal_part, fractional_part = num_string.split('.')
13 while len(decimal_part) > 3:
14 thousands.insert(0, decimal_part[-3:])
15 decimal_part = decimal_part[0:-3]
17 thousands.insert(0, decimal_part)
19 if type(number) is int:
20 return ','.join(thousands)
22 return ','.join(thousands) + '.' + fractional_part
25 """ Removes the contents of a directory, but not the directory itself
27 names = os.listdir(path)
29 fullname = os.path.join(path, name)
30 if os.path.isdir(fullname):
31 shutil.rmtree(fullname)