Skip to main content

format_file_size

Function format_file_size 

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

Format a byte count with a binary unit suffix.

ยงExample:

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

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