paramquery / grid

jQuery grid plugin based on jQueryui widget design
paramquery.com
GNU General Public License v3.0
543 stars 255 forks source link

How to Set 'percent' DataType in colModel ?? #168

Open Eddy-Q opened 5 years ago

Eddy-Q commented 5 years ago

I find a demo in ParamQuery official website: col.format = function (val) { return (val == null || val == "") ? "" : (pq.formatNumber(val, "##.00%") / 100 ); }; col.deFormat = function (val) { return (pq.deFormatNumber(val.split('%'), "##.00")* 100) }; col.dataType = 'float'; I tried this one that I don't understand why DeFormat doesn't work.

I want to know how to calculate Numbers that are already "format" Like..................... 100 11 0.3/ (1+0.3) =253.85 When I set format: ".00% "and type 30, it says" 30%, "but the value is actually 30 instead of 0.3.


我试过这个官网的,我不明白为什么deFormat 不起作用,
我想知道如何计算已经“格式化”的数字
比如…………
100110.3/(1+0.3)=253.85
当我设置格式:“.00%”和类型30时,它表示“30%”,但实际值是30而不是0.3。 QQ图片20190819153354

paramquery commented 5 years ago

% format is not supported yet, it would be supported in upcoming versions.

Eddy-Q commented 5 years ago

% format is not supported yet, it would be supported in upcoming versions.

Thank you for answering