# Prevent ImportString from rounding values

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.)

This is actually illusory! Mathematica does not round values on import; it just shows you a rounded value in the output cell.

To see this, look at

ImportString["10000.11", "TSV"] // FullForm


If you want to change this display behavior, you can go to Mathematica > Preferences (command + , if you're on a Mac), select the Appearance tab, and change the number shown under Displayed Precision (which is by default 6).

• I'll mark this as correct, as it demonstrates that MMA knows all the digits are there. But applying ToString on 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 use ToString, I find I can use ToString[InputForm[_value_]] and I get all digits, unrounded. Mar 15, 2021 at 10:47
• Nice. By the way, since another way of doing this is ToString[value, FormatType -> InputForm], If you want, you can make that the default behavior for ToString: just evaluate SetOptions[ToString, FormatType -> InputForm]. Then (as long as you're in the same kernel session/notebook), ToString will not round automatically. (StandardForm also seems to work.) Mar 15, 2021 at 23:24