tweak the number of decimal places in the file size display a little.

This commit is contained in:
Charles Kerr
2007-12-21 22:43:14 +00:00
parent 8c7434dded
commit ccc804e06a

View File

@@ -64,10 +64,10 @@ tr_strlsize( char * buf, guint64 size, size_t buflen )
guint64 small = size;
for( i=0; i<G_N_ELEMENTS(units) && small>=1024; ++i )
small >>= 10;
if( small < 100 )
g_snprintf( buf, buflen, "%.1f %s", (double)small, _(units[i]) );
else
if( i < 2 ) /* B & KiB */
g_snprintf( buf, buflen, "%d %s", (int)small, _(units[i]) );
else
g_snprintf( buf, buflen, "%.1f %s", (double)small, _(units[i]) );
}
return buf;
}