ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: noctrona on June 05, 2014, 07:23:41 am

Title: Question about currency value display.
Post by: noctrona on June 05, 2014, 07:23:41 am
Hi,

As our API, we can assign a data type for each column. And I have a problem, I have some columns' data type are "integer/float", I can display integer/ float value directly and also have some auto validation can avoid user input and letter or other invalid value.

But now I want to add number format (the thousands comma) for each value. So the problem is if I change my value as "5,000", it will be a string and can't display on an "integer/float" type cell. I know I can change the data type to "string", but it's mean I need to add some validation manually.

-----------------------------
I found "render" can solve my problem. And it works well now.



Thank you!
Title: Re: Question about currency value display.
Post by: paramvir on June 05, 2014, 08:18:02 am
There is no need to change the format of the data. you can display the currency format in the view using column.render callback.

Live example:

http://paramquery.com/pro/demos/grid_json
Title: Re: Question about currency value display.
Post by: noctrona on June 05, 2014, 08:29:37 am
There is no need to change the format of the data. you can display the currency format in the view using column.render callback.

Live example:

http://paramquery.com/pro/demos/grid_json

Hi,

Yes. Already use this way to display currency. Thank you!

One more thing about formatCurrency. It looks we packaged the jquery method as a paramQuery method. So is that possible can add a parameter to set the separator sign. Because in different local, the separator have different. Some will use comma, some will use dot.