Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Eddy-Q opened this issue Aug 19, 2019 · 2 comments
Open

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

Eddy-Q opened this issue Aug 19, 2019 · 2 comments

Comments

@Eddy-Q
Copy link

Eddy-Q commented Aug 19, 2019

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
Copy link
Owner

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

@Eddy-Q
Copy link
Author

Eddy-Q commented Aug 20, 2019

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

Thank you for answering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants