score:14

Accepted answer

Unfortunately that's not possible, I am afraid: the default tooltip formatters are somewhat hidden inside the Point and Tooltip objects and do not provide access to the number formatting.

However, you may want to globally override the default implementation of a Point's tooltipFormatter with something of your own, e.g.

Highcharts.Point.prototype.tooltipFormatter = function (useHeader) {
    var point = this, series = point.series;
    return ['<span style="color:' + series.color + '">', (point.name || series.name), '</span>: ',
        (!useHeader ? ('<b>x = ' + (point.name || point.x) + ',</b> ') : ''),
        '<b>', (!useHeader ? 'y = ' : ''), Highcharts.numberFormat(point.y, 0), '</b>'].join('');
};

This implementation is the same as the default one except for the Highcharts.numberFormat call on the last line, which will do your number formatting.

Keep in mind that such a change will apply to all your charts.

score:-1

The way to apply Math.round() function inside the highchart script.

series: [{
    type: 'pie',
    name: 'CPU (GHz)',
    data: [
            ['Used',Math.round( <?php echo $gSum_Allocated_CPU; ?>, 2)],
            {
                name: 'Available',
                y:Math.round(<?php echo $gSum_Available_CPU; ?>, 2),
                sliced: true,
                selected: true
             }
          ]
     }]

score:1

Since 2.2 there is a new option "pointFormat" to specify a separate formater for the pointvalues only: http://api.highcharts.com/highcharts#tooltip.pointFormat

score:3

Use pointFormatter to format shared tooltip. This is available since version 4.1.0:

tooltip: {
    shared: true,
    pointFormatter: function() { 
        return '<span style="color:' + this.series.color + ';">‚óŹ</span> ' + this.series.name + ': <b>' + numberFormat(this.y) + '</b><br/>'; 
    }
}

Related Query

More Query from same tag