jjuback / gc-excelviewer

Visual Studio Code extension for viewing Excel spreadsheets and CSV files.
Other
216 stars 39 forks source link

MAC address displayed as "Infinity" #173

Open KamasamaK opened 2 years ago

KamasamaK commented 2 years ago

I have a CSV file with one of the columns as a MAC address (12 hexadecimal characters) with no separators. A small number of the MAC addresses were displayed as "Infinity" in the preview.

Here is a sample of the first 5 in my file

"MacAddr"
"001E46977290"
"00080E579718"
"407009E70322"
"001E46977274"
"00403670E976"

And they display as follows image

This seems to be related to the setting csv-preview.formatValues since when I change it from the default value of always it fixes it.

The only pattern I've found is that these all contain 11 decimal digits and one E.

jjuback commented 2 years ago

As you discovered, you can set the csv-preview.formatValues setting to unquoted. That way, any value enclosed in quotes will be displayed as-is, but unquoted numeric values will respect the csv-preview.numberFormat setting (default: g2).