Skip to content
Snippets Groups Projects
Verified Commit 7f0a5710 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix size formatting in installer TUI

parent 70a2dc75
No related branches found
No related tags found
No related merge requests found
......@@ -68,13 +68,13 @@ const GB: u64 = 1024 * MB;
const TB: u64 = 1024 * GB;
fn format_size(size: u64) -> String {
if size % TB == 0 {
if size >= TB {
format!("{} TB", size / TB)
} else if size % GB == 0 {
} else if size >= GB {
format!("{} GB", size / GB)
} else if size % MB == 0 {
} else if size >= MB {
format!("{} MB", size / MB)
} else if size % KB == 0 {
} else if size >= KB {
format!("{} KB", size / KB)
} else {
format!("{} B", size)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment