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(
}
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
Hello,
Is there any way to show negative values. like -$3000 in excel cell and when click on that value it should display -3000 in formula bar at upper side in excel sheet.
Nandu
Hi Nandu,
You can format Excel cell values by assigning an acceptable format string.
In your case you should use a string, similar to the one from the code snippet below, thus dispalying any number as currency.
cell.Value = -3000;
cell.CellFormat.FormatString = "$0000.00";
Save your Workbook as a file, open it, observe. I hope you get the target behavior.
Stefana