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

Free Support Forum - aspose.com

Numeric data in CSV

Hi,

I have passed “false” to setConvertNumericData method since numbers having more than 15 digits gets rounded off.

Is it possible to convert text to number only if it’s a valid and supported number and keep it as text if conversion is not possible?

@beekay,

Thanks for your query.

Well, there is no automatic option available for parsing numbers less than 15 digits only in MS Excel. You can write your own logic and code to handle it by yourself using your preferred parser via relevant Aspose.Cells APIs. See the document with example code for your reference (the code is in .NET but you may easily write your Java code accordingly):
https://docs.aspose.com/display/cellsnet/Opening+Files+with+Different+Formats#OpeningFileswithDifferentFormats-Usingpreferredparser

For example, while writing code in the class that implements the ICustomParser, if you only want numeric values with more than 15 digits should have been parsed, then you can just check the length of string first, if it is number and its total digits is greater than 15, then return it as string. Otherwise just return it as null in the parseObject overloaded method, so Aspose.Cells should continue to parse the data automatically and accordingly.

Hope, this helps a bit.