GNOME Bugzilla – Bug 628044
g_format_size_for_display format precision
Last modified: 2010-09-01 13:54:49 UTC
Right now g_format_size_for_display can produce such strings as 1.1 KB 50.1 KB 914.1 KB That is between 2 and 4 significant digits (or a wider range if you do not consider an initial 1 a full significant digit). That's too much. Alternatively you can look at the worst-case rounding error for the displayed result as varying between 5% and 0.05% In order to produce more reasonable results, I propose that the format be "%.0f" when the scaled number is >=99.5 That would also have the minor benefit of producing a string of more uniform length leading to a less "bouncy" GUI when this function is used for, say, data-left-to-transfer.
This was previously discussed in bug 594918, see esp. bug 594918 comment 27.
*** This bug has been marked as a duplicate of bug 594918 ***