Commit 123cd0f1 authored by Otto Jonassen Wittner's avatar Otto Jonassen Wittner
Browse files

Added rounding of summary data in popups

parent 4882cafe
Pipeline #125926 passed with stages
in 1 minute and 3 seconds
......@@ -844,7 +844,8 @@ function link_popup(link){
// Only digested summary of none-summary properties is available.
for (const sum_var in conffile[parms.net].event_type[parms.event].field) {
if ( typeof link[sum_var] != 'undefined' ) {
tip+= '<tr><td>' + prop_desc[sum_var] + '<td align=right>' + link[sum_var];
var prop_value = Math.round((link[sum_var] + Number.EPSILON) * 100) / 100; // Round off to (max) 2 decimals
tip+= '<tr><td>' + prop_desc[sum_var] + '<td align=right>' + prop_value;
nrows++;
}
}
......@@ -852,7 +853,8 @@ function link_popup(link){
for (const s in conffile[parms.net].event_type[parms.event].popup.summary) {
var sum_var = conffile[parms.net].event_type[parms.event].popup.summary[s];
if ( typeof link[sum_var] != 'undefined' ) {
tip+= '<tr><td>' + prop_desc[sum_var] + '<td align=right>' + link[sum_var];
var prop_value = Math.round((link[sum_var] + Number.EPSILON) * 100) / 100; // Round off to (max) 2 decimals
tip+= '<tr><td>' + prop_desc[sum_var] + '<td align=right>' + prop_value;
nrows++;
}
}
......@@ -1978,6 +1980,10 @@ function get_connections(){
if (parms.debug) console.log(url);
// Clear current dataset (details and summary)
last_hits=[];
summary=[];
$.getJSON( url,
function(resp){
if (resp.hits && resp.hits.total.value > 0){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment