summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 83a6c28)
raw | patch | inline | side by side (parent: 83a6c28)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 19 Aug 2009 07:47:07 +0000 (07:47 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 19 Aug 2009 07:47:07 +0000 (07:47 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3/program@1896 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_graph.c | patch | blob | history |
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 1ccbdf87951b059c0009e9b67de0b4c8b79acb51..1505d5f780456277c0473e2cd037ce618f23c1a4 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
array[step] = data[step * src->ds_cnt];
}
qsort(array, step, sizeof(double), vdef_percent_compar);
- field = (steps - 1) * dst->vf.param / 100;
+ field = round((dst->vf.param * (double)(steps - 1)) / 100.0);
dst->vf.val = array[field];
dst->vf.when = 0; /* no time component */
free(array);
printf("DEBUG: %3li:%10.2f %c\n",
step, array[step], step == field ? '*' : ' ');
#endif
- }
+ }
break;
case VDEF_MAXIMUM:
step = 0;