diff options
author | 2025-02-15 14:06:10 +0100 | |
---|---|---|
committer | 2025-02-15 14:06:10 +0100 | |
commit | 8694eeb5c5ace4c2343e1eec3e64e27d36b656bd (patch) | |
tree | 5f241167cae46be491ac41c9382c823eff3979c0 /examples | |
parent | edb5a66c5339c5d7e2fddd5b796434d83edadb3e (diff) | |
download | iced-8694eeb5c5ace4c2343e1eec3e64e27d36b656bd.tar.gz iced-8694eeb5c5ace4c2343e1eec3e64e27d36b656bd.tar.bz2 iced-8694eeb5c5ace4c2343e1eec3e64e27d36b656bd.zip |
Use SI metrics for memory in `system_information` example
Diffstat (limited to 'examples')
-rw-r--r-- | examples/system_information/src/main.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/system_information/src/main.rs b/examples/system_information/src/main.rs index afa657d8..56f934b7 100644 --- a/examples/system_information/src/main.rs +++ b/examples/system_information/src/main.rs @@ -102,22 +102,22 @@ impl Example { ); let memory_readable = - ByteSize::b(information.memory_total).to_string(); + ByteSize::b(information.memory_total).to_string_as(true); let memory_total = text!( "Memory (total): {} bytes ({memory_readable})", information.memory_total, ); - let memory_text = if let Some(memory_used) = - information.memory_used - { - let memory_readable = ByteSize::b(memory_used).to_string(); + let memory_text = + if let Some(memory_used) = information.memory_used { + let memory_readable = + ByteSize::b(memory_used).to_string_as(true); - format!("{memory_used} bytes ({memory_readable})") - } else { - String::from("None") - }; + format!("{memory_used} bytes ({memory_readable})") + } else { + String::from("None") + }; let memory_used = text!("Memory (used): {memory_text}"); |