The value must be four digits after the decimal point.
Ajax call method:
$.each(data.RESULTSET,function(i,ele){ ele.MTUR_YLD = cellRenderNum100(null,"MTUR_YLD",ele.MTUR_YLD); ele.TMT_YLD = cellRenderNum100(null,"TMT_YLD",ele.TMT_YLD); })
Jqwidgets: jqxgrid call method:
source: { localdata : data.RESULTSET, datatype : "array", datafields : [ {name : 'QTN_ID',type : 'int'}, {name : 'TERM_BEG',type : 'string'}, {name : 'TERM_END',type : 'string'}, {name : 'MTUR_YLD',type : 'string',cellsrenderer:cellRenderNum100}, {name : 'TMT_YLD',type : 'string',cellsrenderer:cellRenderNum100} ] },
Method:
// Obtain the four digits after the decimal point and forcibly display the four digits after the decimal point @ author zhangyunyang 2014-12-18function cellRenderNum100 (row, columnfield, value) {var value_str = String (value * 100 ); if (value_str.length> 6) {value_str = value_str.substring (0, 6);} else {if (value_str.indexOf (". ")! =-1) {var varr = value_str.split ('.'); var rlg = 4-varr [1]. length; for (var I = 0; I