Code Monkey home page Code Monkey logo

Comments (1)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 21, 2024
By default, jquery-csv does not apply implicit casting. In short, the data 
inputted to the parser is a string so the result will be strings.

There are 2 reasons for this. First, CSV is a text-based format so it's faster 
to skip any implicit casting. Second, applying implicit casting by default 
makes the assumption that the output format should be scalar; when that is not 
desired it creates unexpected side-effects.

If you need the parser to apply implicit casting there is a parser hook called 
castToScalar() that will accomplish what you require.

The following snippet is copied directly from the Google Visualization API's 
example code.
   var parsedData = $.csv.toArrays(csv, {
        onParseValue: $.csv.hooks.castToScalar
    });

Note: In the 'options' argument, create an object literal with a property named 
onParseValue, and set the property's value to $.csv.hooks.castToScalar.

Original comment by [email protected] on 15 Feb 2015 at 4:59

  • Changed state: Done

from jquery-csv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.