You can use autoType. autoType
will covert all your data types automatically. It tries its best to detect the type automatically for you, but it may have false positives sometimes.
var data = d3.csv(pathToCsv, d3.autoType)
CLICK HERE to find out more related problems solutions.