Skip to content
Snippets Groups Projects
Commit c070791a authored by tuckersiegel's avatar tuckersiegel
Browse files

round off to nearest integer

parent 14b63059
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@ function find(collection, query, projection, t_base, res, product) {
for (var i = 0; i < min_temps.length; i++) {
gdd_value = utils.calculate_gdd(min_temps[i], max_temps[i], t_base, product);
gdd_value = Math.round(gdd_value);
gdd_sum += gdd_value
gdds.push(gdd_sum)
}
......@@ -54,6 +55,8 @@ function find_normal(collection, query, projection, t_base, res, product) {
for (var i = 0; i < gdd_base.length; i++) {
gdd_value = (gdd_base[i] - t_base);//utils.calculate_gdd(min_temps[i], max_temps[i], t_base, product);
gdd_value = gdd_value < 0 ? 0 : gdd_value;
gdd_value = Math.round(gdd_value);
gdd_sum += gdd_value
gdds.push(gdd_sum)
}
......
......@@ -55,6 +55,9 @@ function find(collection, query, projection, t_base, res, product, confidence_in
min_gdd_value = min_gdd_value < 0 ? 0 : min_gdd_value;
max_gdd_value = max_gdd_value < 0 ? 0 : max_gdd_value;
min_gdd_value = Math.round(min_gdd_value);
max_gdd_value = Math.round(max_gdd_value);
min_gdd_sum += min_gdd_value
max_gdd_sum += max_gdd_value
......
......@@ -25,6 +25,8 @@ function find(collection, query, projection, t_base, res, product) {
for (var i = 0; i < min_temps.length; i++) {
gdd_value = utils.calculate_gdd(min_temps[i], max_temps[i], t_base, product);
gdd_value = Math.round(gdd_value);
gdds.push(gdd_value)
}
send_response("GDDs", gdds, data, res);
......
......@@ -20,6 +20,8 @@ function find(collection, query, projection, t_base, res, product) {
for (var i = 0; i < gdd_base.length; i++) {
gdd_value = (gdd_base[i] - t_base);//utils.calculate_gdd(min_temps[i], max_temps[i], t_base, product);
gdd_value = gdd_value < 0 ? 0 : gdd_value;
gdd_value = Math.round(gdd_value);
gdds.push(gdd_value)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment