From 01647426101cfcd2def766d7c64321bf2994b9d9 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Sat, 7 Dec 2019 10:09:42 +1100 Subject: [PATCH] Add decimals display to notifier sync speed (#678) --- beacon_node/client/src/notifier.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon_node/client/src/notifier.rs b/beacon_node/client/src/notifier.rs index 9b4612a1b..e487da1f5 100644 --- a/beacon_node/client/src/notifier.rs +++ b/beacon_node/client/src/notifier.rs @@ -162,10 +162,10 @@ fn sync_rate_pretty(slots_since_last_update: Slot, update_interval_secs: u64) -> if slots_since_last_update == 0 { "No progress".into() } else { - format!( - "{} slots/sec", - slots_since_last_update / update_interval_secs - ) + let distance = f64::from(slots_since_last_update.as_u64() as u32); + let time = f64::from(update_interval_secs as u32); + + format!("{:.2} slots/sec", distance / time) } }