From: Dennis Schafroth Date: Fri, 20 Apr 2012 08:33:51 +0000 (+0200) Subject: Round approx X-Git-Tag: v1.6.13~23^2~11 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=2f8b2679c4e4d7f482d726ebfee201035d6e3192;p=pazpar2-moved-to-github.git Round approx --- diff --git a/src/client.c b/src/client.c index eee0396..dcbfd6c 100644 --- a/src/client.c +++ b/src/client.c @@ -1328,7 +1328,7 @@ Odr_int client_get_hits(struct client *cl) Odr_int client_get_approximation(struct client *cl) { if (cl->record_offset > 0) { - Odr_int approx = (cl->hits * (cl->record_offset - cl->filtered)) / cl->record_offset; + Odr_int approx = ((10 * cl->hits * (cl->record_offset - cl->filtered)) / cl->record_offset + 5) /10; yaz_log(YLOG_LOG, "%s: Approx: %lld * %d / %d = %lld ", client_get_id(cl), cl->hits, cl->record_offset - cl->filtered, cl->record_offset, approx); return approx; }