File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
usr/lib/linuxmint/mintUpdate Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 8888
8989BLACKLIST_PKG_NAME = 0
9090
91- GIGABYTE = 1000 ** 3
92- MEGABYTE = 1000 ** 2
93- KILOBYTE = 1000
94-
9591
9692def size_to_string (size ):
97- if (size >= GIGABYTE ):
98- return "%d %s" % (size // GIGABYTE , _ ("GB" ))
99- if (size >= (MEGABYTE )):
100- return "%d %s" % (size // MEGABYTE , _ ("MB" ))
101- if (size >= KILOBYTE ):
102- return "%d %s" % (size // KILOBYTE , _ ("KB" ))
103- return "%d %s" % (size , _ ("B" ))
93+ f_size = float (size )
94+ units = ['B' , 'KB' , 'MB' , 'GB' ]
95+ for unit in units :
96+ if f_size >= 1000 :
97+ f_size /= 1000
98+ else :
99+ break
100+ if f_size >= 10 :
101+ return f"{ f_size :.0f} { _ (unit )} "
102+ else :
103+ return f"{ f_size :.1f} { _ (unit )} "
104+
104105
105106def name_search_func (model , column , key , iter ):
106107 name = model .get_value (iter , column )
You can’t perform that action at this time.
0 commit comments