Add decimals display to notifier sync speed (#678)

This commit is contained in:
Paul Hauner 2019-12-07 10:09:42 +11:00 committed by Age Manning
parent d4b28d48f8
commit 0164742610

View File

@ -162,10 +162,10 @@ fn sync_rate_pretty(slots_since_last_update: Slot, update_interval_secs: u64) ->
if slots_since_last_update == 0 { if slots_since_last_update == 0 {
"No progress".into() "No progress".into()
} else { } else {
format!( let distance = f64::from(slots_since_last_update.as_u64() as u32);
"{} slots/sec", let time = f64::from(update_interval_secs as u32);
slots_since_last_update / update_interval_secs
) format!("{:.2} slots/sec", distance / time)
} }
} }