Fixed shorten axis units

This commit is contained in:
danielmaya 2018-03-09 10:18:02 +01:00
parent 5a13db5a18
commit 64b62edd90
1 changed files with 6 additions and 1 deletions

View File

@ -1928,7 +1928,12 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
var formatted = number_format(v, force_integer, "", short_data); var formatted = number_format(v, force_integer, "", short_data);
} }
else { else {
var formatted = v; // It is an integer
if(v - Math.floor(v) == 0){
var formatted = number_format(v, force_integer, "", 2);
} else {
var formatted = v;
}
} }
return '<div class='+font+' style="font-size:'+font_size+'pt;">'+formatted+'</div>'; return '<div class='+font+' style="font-size:'+font_size+'pt;">'+formatted+'</div>';