Home forums Using CanvasJS How to preserve zeros after decimal point in tooltip? Reply To: How to preserve zeros after decimal point in tooltip?

#22998

all these rules are still required:
contentFormatter: function (e) {
var content = ” “;
for (var i = 0; i < e.entries.length; i++) {

if( e.entries[i].dataPoint.y <= 1.24 )
return “” + CanvasJS.formatNumber(e.entries[i].dataPoint.y, “#,##0.0”) + ““;
else
if( e.entries[i].dataPoint.y <= 1.25 )
return “<2.5“;
else
return “” + CanvasJS.formatNumber(e.entries[i].dataPoint.y, “#,##0.0”) + ““;
}