vscode-data-preview icon indicating copy to clipboard operation
vscode-data-preview copied to clipboard

Numeric column data type (int/float) is determined by the first row value and rounded accordingly

Open nisan-tagar opened this issue 2 years ago • 0 comments

When opening JSON or XLSX files with data preview, the tool determines the data type of the numeric column based on the first row entry and does not look at all the data set for the correct data type required. Example, for this data set:

[
  {
    "Amt": 2500.00,
  },
  {
    "Amt": 50.25,
  }
]

Data preview will assume that the "Amt" column is of type int and truncate all the data set shown in the grid table. However if the rows are reversed then the data type is set correctly to float and the grid table values are correct as well:

[
  {
    "Amt": 50.25,
  },
  {
    "Amt": 2500.00,
  }
]

nisan-tagar avatar Dec 27 '22 00:12 nisan-tagar