From 21cab03cc713bd14bcab60849b72f70a75329a2e Mon Sep 17 00:00:00 2001 From: aggieNick02 Date: Mon, 14 Feb 2022 15:13:50 -0600 Subject: [PATCH] Fix ETA display when rate and/or rate_min are specified The base passed to num2str in the ETA display code passed the wrong base (0 instead of 1). Additionally, je->sig_figs was never set and defaulted to 0. Both of these caused the desired range in the ETA code to always display 0-0 when rate or rate_min was specified. Signed-off-by: Nick Neumann nick@pcpartpicker.com --- eta.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eta.c b/eta.c index ea1781f3..17970c78 100644 --- a/eta.c +++ b/eta.c @@ -420,6 +420,7 @@ bool calc_thread_status(struct jobs_eta *je, int force) if (is_power_of_2(td->o.kb_base)) je->is_pow2 = 1; je->unit_base = td->o.unit_base; + je->sig_figs = td->o.sig_figs; if (td->o.bw_avg_time < bw_avg_time) bw_avg_time = td->o.bw_avg_time; if (td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING @@ -600,9 +601,9 @@ void display_thread_status(struct jobs_eta *je) char *tr, *mr; mr = num2str(je->m_rate[0] + je->m_rate[1] + je->m_rate[2], - je->sig_figs, 0, je->is_pow2, N2S_BYTEPERSEC); + je->sig_figs, 1, je->is_pow2, N2S_BYTEPERSEC); tr = num2str(je->t_rate[0] + je->t_rate[1] + je->t_rate[2], - je->sig_figs, 0, je->is_pow2, N2S_BYTEPERSEC); + je->sig_figs, 1, je->is_pow2, N2S_BYTEPERSEC); p += sprintf(p, ", %s-%s", mr, tr); free(tr); -- 2.25.1