We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Format a currency column

Thread ID:





126139 Sep 26,2016 06:50 PM Sep 29,2016 11:28 PM ASP.NET MVC 5
Tags: Grid
Asked On September 26, 2016 06:50 PM


I want to set the format of currency, with negatives values, if the value of the column is -200, I want that the result is -$200, rigth now it shows that the value is ($200)

Karthick Kuppusamy [Syncfusion]
Replied On September 27, 2016 09:29 AM

Hi Dayne, 

Thanks for Contacting Syncfusion Support. 

We have analyzed your requirement and while we set the negative value for the currency column the jquery currency format will be automatically convert the negative value to the parenthesis value. 

This is the default behavior. 

Please find the link for your reference. 


Replied On September 27, 2016 10:22 AM

Hi, but I don't want the default behavior, I want the negative result, for example:

If the value is: 200 the result sould be $200.00

If the value is: -200 the result sould be -$200.00 instead of ($200)

Is this posible?

Karthick Kuppusamy [Syncfusion]
Replied On September 29, 2016 04:37 AM

Hi Dayne, 

We have analyzed your requirement and we can change the format for Currency values through the QueryCellInfo event of the grid. 

Please find the code example. 

        .EditSettings(edit=>{edit.AllowAdding().AllowDeleting().AllowEditing(); }) 
         .ClientSideEvents(e => e.QueryCellInfo("QueryCellInfo")) 
         .Columns(col => 
            col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add(); 
            col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add(); 
            col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(TextAlign.Right).Width(75).Add(); 
            col.Field("ShipCity").HeaderText("Ship City").Width(110).Add(); 
    function QueryCellInfo(args) { 
        if (args.column.field == "Freight" && args.data.Freight < 0) { 
            args.cell.innerHTML = "-" + ej.format(args.data.Freight * -1, "C2"); 

For your reference we have created a sample based on your requirement and same it can be downloaded from the following location. 

Please refer the following UG Link for more information. 


Replied On September 29, 2016 09:42 AM

Thanks very much, this solucion works fine.

Karthick Kuppusamy [Syncfusion]
Replied On September 29, 2016 11:28 PM

Hi Dayne, 

Thanks for the update. 

We are happy to hear that your requirement is achieved. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.