Hi team,
I a problem about display value on paramquery table. I hope you can give me some suggestion.
I have a demand, we have a table to display some records and each column display the currency value. So the column type I use "float". Then our client have a demand, our system user from different countries, so they hope the value which display on the table can have the different currency format for different user location.
For example, the value I get is a string "1234.56"
If a user from US, I will format this value like "1,234.56".(Use comma format value)
If a user from Sweden, I will format this value like "1 234,56". (Use blank and comma format value)
If a user from Denmark, I will format value like "1.234,56". (Use dot and comma format value.)
So the problem is my column type is "integer/float", so if I format the value like the above format string, and use render function display them, I think the pggrid will auto format the string value to "integer/float" type, the some part for my value will lost.
Like
{ title: "Volume", width: 50, dataType: "integer",halign:"center",align: "right",dataIndx: "volume",
render: function (ui) {
return (renderTotalorBlank(ui))
}
}
function renderTotalorBlank(ui){
return ((ui.cellData > 0) ? commafy(ui.cellData) : '');
}
The "commafy()" function will format my value. And return a string.
I don't know whether I described clearly. I hope you can give me some suggestion. Actually, I don't want to change my column type to string, because I need to write some validation manually for a string cell.
Thank you!