From 4c3727b4a3a5bae04843a16fd676fc81b7f27cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?fde=C4=89?= Date: Fri, 22 May 2020 12:10:56 +0200 Subject: [PATCH] use format! for rounding to fix arm issue --- src/util.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util.rs b/src/util.rs index 09b19e02..ace247be 100644 --- a/src/util.rs +++ b/src/util.rs @@ -242,9 +242,7 @@ pub fn get_display_size(size: i32) -> String { } } - // Round to two decimals - let size = ((size * 100.) as f32).round() / 100.; - format!("{} {}", size, UNITS[unit_counter]) + format!("{:.2} {}", size, UNITS[unit_counter]) } pub fn get_uuid() -> String {