You can use custom formatter to do what you want. To format numbers or integers correctly you can call $.fmatter.util.NumberFormat method with $.jgrid.formatter.number or $.jgrid.formatter.integer as the second parameter. The example of the formetter is
formatter: function (cellvalue, options) {
var value = parseFloat(cellvalue), retult,
op = $.extend({}, $.jgrid.formatter.number); // or $.jgrid.formatter.integer
if(!$.fmatter.isUndefined(options.colModel.formatoptions)) {
op = $.extend({}, op,options.colModel.formatoptions);
}
retult = $.fmatter.util.NumberFormat(Math.abs(value), op);
return (value >= 0 ? retult : '(' + retult + ')') + ' €';
}
you can additionally change color or some other CSS style of displaying of the negative numbers. You can use cellattr property to add class or style attribute in the cells with negative numbers:
You can use custom formatter to do what you want. To format numbers or integers correctly you can call
$.fmatter.util.NumberFormat
method with$.jgrid.formatter.number
or$.jgrid.formatter.integer
as the second parameter. The example of the formetter isyou can additionally change color or some other CSS style of displaying of the negative numbers. You can use
cellattr
property to addclass
orstyle
attribute in the cells with negative numbers:The demo demonstrate the settings. The results are the following