We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to format cell's as text when input percentage data

I have a cell, its format is text, but when I input 100%, it changes to 1

any idea to set its format, no matter what data input, always is text type. I need the result is 100%, not 1.

Actually, If I set cell format as Text, this problem will disapear.

how to set a cell format to Text, and input 100%, still show as 100%, not 1



Please see the following sample code on how to specify “Text” number formatting applied to a cell for your reference:
Sample code:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
Aspose.Cells.Cell cell = worksheet.Cells[“A1”];
Style style = cell.GetStyle();
style.Custom = “@”;

Also, see the document on how to apply different numbers formattings to cells for your complete reference:

Hope, this helps a bit.

Thank you.