linuxmint / mintupdate

The Linux Mint Update Manager
309 stars 152 forks source link

Replace your own size_to_string with GLib.format_size? #789

Open carlosmintfan opened 1 year ago

carlosmintfan commented 1 year ago

Would that be ok? If you want values that are fully rounded to KB/MB/KB, you could round them before giving the values to GLib.format_size.

carlosmintfan commented 1 year ago

But is rounding really necessary? Let me see -

print(GLib.format_size(3400200134)) 3.4 GB print(GLib.format_size(3428)) 3.4 kB print(GLib.format_size(3998)) 4.0 kB Well, it doesn't just say 4 kB, there's that zero... print(GLib.format_size(4000)) 4.0 kB

Well, do you think replacing your own size_to_string with GLib.format_size would be good or not?