Added function to KiraSize to format size with B suffix.

This commit is contained in:
2026-06-06 00:24:36 +02:00
parent 56e87a62cf
commit 4d8c9540d0
+7
View File
@@ -46,6 +46,13 @@ impl std::fmt::Display for KiraSize {
impl KiraSize {
pub const SUFFIXS: [&str; 5] = ["KB", "MB", "GB", "TB", "PB"];
/// returns size in bytes suffixed with "B" character
pub fn to_parted_bytes_str(&self)-> String {
format!("{}B", self.size_bytes)
}
pub fn new_b(size:u64) -> Self {
Self { size_bytes: size }
}