Jqgrid currency format

Adnan Khan picture Adnan Khan · May 13, 2011 · Viewed 17.3k times · Source

I have a jqgrid, its option :formatter => "currency"

It is converting number 5 as $5.00, but this is a credit amount so I need to display it as ($5.00) instead of $5.00.

Any recommendations what should I change in :formatter => "currency"?

Answer

Oleg picture Oleg · May 13, 2011

You should examine options of the currency formatter. You can define prefix, and suffix. For example you can use the following options

formatter:'currency',
formatoptions: {prefix:'($', suffix:')', thousandsSeparator:','}

The demo shows in the 'Total' column the numbers in the form which you need.

enter image description here