rename variable

This commit is contained in:
yggverse 2024-12-11 10:58:41 +02:00
parent c53846649c
commit eb1090341f

View File

@ -974,14 +974,14 @@ fn snap_history(navigation: Rc<Navigation>) {
} }
/// Format bytes to KB/MB/GB presentation /// Format bytes to KB/MB/GB presentation
fn format_bytes(total: usize) -> String { fn format_bytes(value: usize) -> String {
if total < 1024 { if value < 1024 {
format!("{} bytes", total) format!("{} bytes", value)
} else if total < 1024 * 1024 { } else if value < 1024 * 1024 {
format!("{:.2} KB", total as f64 / 1024.0) format!("{:.2} KB", value as f64 / 1024.0)
} else if total < 1024 * 1024 * 1024 { } else if value < 1024 * 1024 * 1024 {
format!("{:.2} MB", total as f64 / (1024.0 * 1024.0)) format!("{:.2} MB", value as f64 / (1024.0 * 1024.0))
} else { } else {
format!("{:.2} GB", total as f64 / (1024.0 * 1024.0 * 1024.0)) format!("{:.2} GB", value as f64 / (1024.0 * 1024.0 * 1024.0))
} }
} }