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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Format a currency column

Thread ID:





126139 Sep 26,2016 10:50 PM UTC Sep 30,2016 03:28 AM UTC ASP.NET MVC 5
Tags: Grid
Asked On September 26, 2016 10:50 PM UTC


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 01:29 PM UTC

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 02:22 PM UTC

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 08:37 AM UTC

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 01:42 PM UTC

Thanks very much, this solucion works fine.

Karthick Kuppusamy [Syncfusion]
Replied On September 30, 2016 03:28 AM UTC

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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon