Hi ,
In our application I am using Infragistics.Excel to export the file. But I am not able to apply the Currency format for numeic values. Please how can i specify the currency format.
Ex:- 10,235.00 Ex: 0
Could you please respond soon will be appreciable because this is our immediate requirement and going to production today EOD.
Code snippet:-
Right now I am converting the value to string and applying the format. This cause the different problems. so please let me know the proper solution. If provide the sample application to me will be great helpful to me...
if (value != null && value.ToString() == "0") cell.Value = value.ToString(); else cell.Value = string.Format("{0:0,0}", value); cell.CellFormat.VerticalAlignment = VerticalCellAlignment.Center; cell.CellFormat.Alignment = HorizontalCellAlignment.Right;
Just so you know, storing the values as doubles instead of decimals will result is much better performance and memory usage in the Excel library. And since values are stored in the Excel files as doubles anyway, you won't lose any more precision during a save operation than you would have lost anyway.
Nevermind Its Friday :) was sending variables as a string instead of a decimal DOH !
Team,
I am using the currency format as well it works fine however when the spreadsheet is opened it is being loaded as a text field. I have been searching for a way to actually set the column to be of a decimal value for the entire column but I am not able to see how to set this excel column during code to be a decimal type column for vb.net any help is greatly appreciated.
Mike,
Thank You for quickly responding for the queries.
Anil Kumar
That is how percentage formatting works. If you want to show 2%, the actual value of the cell needs to be 0.02.