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.

Display Currency value with format intact

Thread ID:

Created:

Updated:

Platform:

Replies:

56606 Feb 16,2007 06:19 PM Feb 17,2007 05:25 AM Windows Forms 1
loading
Tags: XlsIO
Navaneeth Rajkumar
Asked On February 16, 2007 06:19 PM

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

Melba Winshia [Syncfusion]
Replied On February 17, 2007 05:25 AM

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

CONFIRMATION

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.

;