summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3f02175)
raw | patch | inline | side by side (parent: 3f02175)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 19 Aug 2009 07:44:34 +0000 (07:44 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 19 Aug 2009 07:44:34 +0000 (07:44 +0000) |
src/rrd_graph.c | patch | blob | history |
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 1ea457b2c27e909ad903c629e5e531eef56cc369..323fec6dcfc1ba3d0d79c455961915e8f16e9ba0 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);
}
}
qsort(array, nancount, sizeof(double), vdef_percent_compar);
- field = (nancount - 1) * dst->vf.param / 100;
+ field = round( dst->vf.param * (double)(nancount - 1) / 100.0);
dst->vf.val = array[field];
dst->vf.when = 0; /* no time component */
free(array);