Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions js/CSVParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ var CSVParser = {
for (var i=0; i < headerNames.length; i++) {
var numFloats = 0;
var numInts = 0;
var isBoolean=[];
for (var r=0; r < numRowsToTest; r++) {
if (dataArray[r]) {
//replace comma with dot if comma is decimal separator
Expand All @@ -138,7 +139,10 @@ var CSVParser = {
if (String(dataArray[r][i]).indexOf(".") > 0) {
numFloats++
}
};
}
if (dataArray[r][i] === "true" || dataArray[r][i] === "false") {
isBoolean.push(true);
}
};

};
Expand All @@ -150,7 +154,7 @@ var CSVParser = {
headerTypes[i] = "int"
}
} else {
headerTypes[i] = "string"
headerTypes[i] = isBoolean.length === numRowsToTest ? "boolean" : "string"
}
}

Expand Down Expand Up @@ -282,4 +286,4 @@ var CSVParser = {



}
}