Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
770
Formatting negative values in excel
posted

Hi,

  I am using export to excel from XamWebGrid. I did formatting for percentage and for doller signn like below

 for example

 tempvalue=24%

 if (tempvalue.ToString().Contains("%"))

{

tempvalue = tempvalue.ToString().Replace(

 

"%", "").Trim();

cell.Value =

 

Convert.ToDouble(tempvalue) / 100;

cell.CellFormat.FormatString =

 

"0.00%";

}

  Now i am getting value like -$4500. I want to format it as -$4500 and also when click . it should display -ve value in formula bar upper part of excel.

So please  give any solution for that.

Thanks,

Nandkishor

 

Parents
No Data
Reply Children
No Data