diff options
author | Karel Zak <kzak@redhat.com> | 2006-12-07 00:26:16 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2006-12-07 00:26:16 +0100 |
commit | c129767e063c5c9839cc9d94c34fd88dac3fb9a6 (patch) | |
tree | 13dd85577b43ec1be3cf51a8d913282c2a92259c /fdisk/cfdisk.c | |
parent | d03dd60840f0a08464d5266539ad356aefe24b03 (diff) | |
download | util-linux-old-c129767e063c5c9839cc9d94c34fd88dac3fb9a6.tar.gz |
Imported from util-linux-2.12b tarball.
Diffstat (limited to 'fdisk/cfdisk.c')
-rw-r--r-- | fdisk/cfdisk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c index 31ddd7e7..9be1c707 100644 --- a/fdisk/cfdisk.c +++ b/fdisk/cfdisk.c @@ -2574,13 +2574,14 @@ draw_screen(void) { mvaddstr(HEADER_START+2, (COLS-strlen(line))/2, line); { long long bytes = actual_size*(long long) SECTOR_SIZE; - long long megabytes = bytes/1000000; + long long megabytes = bytes/(K*K); + if (megabytes < 10000) sprintf(line, _("Size: %lld bytes, %lld MB"), bytes, megabytes); else sprintf(line, _("Size: %lld bytes, %lld.%lld GB"), - bytes, megabytes/1000, (megabytes/100)%10); + bytes, megabytes/K, (10*megabytes/K)%10); } mvaddstr(HEADER_START+3, (COLS-strlen(line))/2, line); sprintf(line, _("Heads: %d Sectors per Track: %d Cylinders: %lld"), |