Display Currency value with format intact

hi,
I have a negative $ amount that I want to export to Excel file.. In what format should I write for the value to be displayed as ($100) in red? should I use the value property or test property?

Thanks

1 Reply

MW Melba Winshia Syncfusion Team February 17, 2007 10:25 AM UTC

Hi Jack,

You can set number format as "[Red]$#,##0" to display the value as ($100) in red.

[C#]

//Inserting data into the first cell of the first worksheet.
sheet.Range["A1"].Number=100;

//Applying Number Format
sheet.Range["A1"].NumberFormat ="[Red]$#,##0";

Here is the sample for your reference:

NumbeFormat.zip

Please take a look at the sample above and let me know if you have any other questions.

Regards,
Melba

Loader.
Up arrow icon