From d9853165e78bffc1d2d4b1fc4ef71fe91b1bd38d Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 16 Mar 2022 19:42:40 -0300 Subject: Add unformated memory total to example --- examples/system_information/src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'examples/system_information/src/main.rs') 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![ -- cgit