summaryrefslogtreecommitdiffstats
path: root/examples/system_information
diff options
context:
space:
mode:
authorLibravatar Richard <richardsoncusto@gmail.com>2022-03-16 19:42:40 -0300
committerLibravatar Richard <richardsoncusto@gmail.com>2022-04-26 18:57:37 -0300
commitd9853165e78bffc1d2d4b1fc4ef71fe91b1bd38d (patch)
tree3eb71b8f1ace2ae371ab16e051fb5b8ce03b85ef /examples/system_information
parent53538b65b1c557015c2900fc28b8916cf719a10b (diff)
downloadiced-d9853165e78bffc1d2d4b1fc4ef71fe91b1bd38d.tar.gz
iced-d9853165e78bffc1d2d4b1fc4ef71fe91b1bd38d.tar.bz2
iced-d9853165e78bffc1d2d4b1fc4ef71fe91b1bd38d.zip
Add unformated memory total to example
Diffstat (limited to 'examples/system_information')
-rw-r--r--examples/system_information/src/main.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/system_information/src/main.rs b/examples/system_information/src/main.rs
index f8ae1aaf..95f57ac0 100644
--- a/examples/system_information/src/main.rs
+++ b/examples/system_information/src/main.rs
@@ -91,9 +91,15 @@ impl Application for Example {
.to_string())
));
+ let memory_readable =
+ ByteSize::kb(information.memory_total).to_string();
+
let memory_total = Text::new(format!(
"Memory (total): {}",
- ByteSize::kb(information.memory_total).to_string()
+ format!(
+ "{} kb ({})",
+ information.memory_total, memory_readable
+ )
));
Column::with_children(vec![