mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 09:10:08 +00:00
rename variable
This commit is contained in:
parent
c53846649c
commit
eb1090341f
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user