projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fbdd351
)
Round approx
author
Dennis Schafroth
<dennis@indexdata.com>
Fri, 20 Apr 2012 08:33:51 +0000
(10:33 +0200)
committer
Dennis Schafroth
<dennis@indexdata.com>
Fri, 20 Apr 2012 08:33:51 +0000
(10:33 +0200)
src/client.c
patch
|
blob
|
history
diff --git
a/src/client.c
b/src/client.c
index
eee0396
..
dcbfd6c
100644
(file)
--- 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;
}