comparison src/util.c @ 10103:a9521c791afe

[gaim-migrate @ 11130] http://calebg.dyndns.org/~caleb/gaim-oldstatus-no-decimal-bytes.diff shouldn't show decimals when dealing with bytes committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 16 Oct 2004 01:05:40 +0000
parents 77a9f7e5516c
children 1a91e814e9d8
comparison
equal deleted inserted replaced
10102:0f1c25270121 10103:a9521c791afe
2362 while ((size_index < 4) && (size_mag > 1024)) { 2362 while ((size_index < 4) && (size_mag > 1024)) {
2363 size_mag /= 1024; 2363 size_mag /= 1024;
2364 size_index++; 2364 size_index++;
2365 } 2365 }
2366 2366
2367 return g_strdup_printf("%.2f %s", size_mag, size_str[size_index]); 2367 if (size_index == 0) {
2368 return g_strdup_printf("%d %s", size, size_str[size_index]);
2369 } else {
2370 return g_strdup_printf("%.2f %s", size_mag, size_str[size_index]);
2371 }
2368 } 2372 }
2369 } 2373 }
2370 2374
2371 char * 2375 char *
2372 gaim_str_seconds_to_string(guint secs) 2376 gaim_str_seconds_to_string(guint secs)