Commit 385243e3 authored by omietanski's avatar omietanski

Percentages in browseradded

parent ba9813f0
Pipeline #20989 passed with stage
in 6 seconds
......@@ -140,9 +140,10 @@ function processCloneDBContents(results) {
var msg = '<a href="'+url+'">'+name+'</a> ('+config_name+')';
if (! (url in existing_urls)) {
existing_urls[url] = true;
final_results[msg] = results[clone].occ;
final_results[msg] = [results[clone].occ,parseFloat(results[clone].tags.percentage[0])];
} else{
final_results[msg] += results[clone].occ;
final_results[msg][0] += results[clone].occ;
final_results[msg][1] += parseFloat(results[clone].tags.percentage[0]);
}
} else {
......@@ -154,7 +155,9 @@ function processCloneDBContents(results) {
}
}
for (var fr in final_results) {
final_results[fr] = final_results[fr]+' clone'+((final_results[fr] === 1) ? '' : 's');
/* We make a round of the percentage * 1000 to keep 2 numbers after the comma and then we divide the
number by 100 to have the percentage with 2 numbers after the comma*/
final_results[fr] = final_results[fr][0]+' clone'+((final_results[fr][0] === 1) ? '' : 's') + ' (' + (Math.round(final_results[fr][1]*10000)/100) + '%)';
}
if (count_non_viewable > 0)
final_results['Non viewable samples'] = count_non_viewable;
......
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