I'm trying to import a table from Excel following this question and answers. In doing so, strings are kept as strings though numeric values get interpreted as Real and some are subsequently rounded. I don't want this rounding to occur.
I think I've identified the fundamental behavior I'm having issues with. One can type (without copy/paste from a spreadsheet) this minimal example:
ImportString["10000.11", "TSV"],
which returns
{{10000.1}}.
This pattern repeats throughout the imported table, seemingly when the value is above 10,000.
Is there a simple way to cut/paste from a spreadsheet and not have Mathematica round values? I've created my own methods, but they feel like hacks. (Such as: import the entire table as String, then do StringSplit, Flatten, etc.)
ToStringon the values in a table (or, to the value in the MWE above) returns a string with the unwanted rounded behavior. For my purposes, I am using MMA to format data from a spreadsheet for use in a LaTeX matrix; to useToString, I find I can useToString[InputForm[_value_]]and I get all digits, unrounded. – GregH Mar 15 '21 at 10:47ToString[value, FormatType -> InputForm], If you want, you can make that the default behavior forToString: just evaluateSetOptions[ToString, FormatType -> InputForm]. Then (as long as you're in the same kernel session/notebook),ToStringwill not round automatically. (StandardFormalso seems to work.) – thorimur Mar 15 '21 at 23:24