Skip to main content

format_file_size

Function format_file_size 

Source
pub fn format_file_size(total_bytes: u64) -> String
Expand description

Get a human readable file size for an arbitrary amount of bytes

use imessage_database::util::size::format_file_size;

let size: String = format_file_size(5612000);
println!("{size}"); // 5.35 MB