[ui] prevent flicker on large FAT32 format.c

* Also convert 1.4TB FAT32 autolabel to 1_4TB rather than 14TB and
  use 2 decimal points rather than 1
This commit is contained in:
Pete Batard 2013-09-22 03:54:50 +01:00
parent 2945389edc
commit 5b2e4d1721
3 changed files with 16 additions and 13 deletions

View file

@ -545,13 +545,13 @@ static BOOL PopulateProperties(int ComboIndex)
HumanReadableSize *= 1024.0;
i--;
}
// If we're beneath the tolerance, round proposed label to an integer, if not, show one decimal point
// If we're beneath the tolerance, round proposed label to an integer, if not, show two decimal point
if (fabs(HumanReadableSize / ceil(HumanReadableSize) - 1.0) < PROPOSEDLABEL_TOLERANCE) {
safe_sprintf(SelectedDrive.proposed_label, sizeof(SelectedDrive.proposed_label),
"%0.0f%s", ceil(HumanReadableSize), suffix[i]);
} else {
safe_sprintf(SelectedDrive.proposed_label, sizeof(SelectedDrive.proposed_label),
"%0.1f%s", HumanReadableSize, suffix[i]);
"%0.2f%s", HumanReadableSize, suffix[i]);
}
// If no existing label is available and no ISO is selected, propose one according to the size (eg: "256MB", "8GB")