Skip to content

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

Description

@Eddy-Q

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions