When I try to write big numbers , for example :
The decimal part gets cut and the number is not formatted as decimal :
If I change it to Number in Excel it get formatted as expected :
What do I need to do for the number be formatted correctly?
Please note that this only happens for number with 10 or more digits before the decimal symbol.
1234.12 will work.
I suggest you to pass CellType = "text" and also pass CellValue = "1234567890.12". This will preserve the value.
Hi Nelson,
When using EPPlus to write a decimal value like 1234567890.12, if Excel isn't displaying the .12 part, it's likely because the cell format hasn't been explicitly set.
To ensure the decimal portion is preserved, you can use the Cell_WriteByIndexWithFormat action and specify the NumberFormat under CellFormat.
Setting the format to "0.####################" will ensure the full decimal value is properly displayed in Excel.
@Nelson André You can achieve this using Cell_ReadByIndex or Cell_ReadByName gave the ReadText as True. If true always reads the cell value as text.
You can Read it as text "1234567890.12" and convert it to Decimal if required.
Thanks and Regards,
PRAVEEN R