Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

HtmlTable.Parsers excludes valid character for floats #1145

Closed
enigmamf opened this Issue Aug 14, 2012 · 2 comments

Comments

Projects
None yet
2 participants

The exponent indicator is valid in a floating point number in javascript, i.e. 1.069e-12, but the match expression for the float parser does not accommodate it, and the convert function strips it out.

Suggest:

'float': {
    match: /^[\d]+\.[\d]+(e-?[\d]+)?/i,
    convert: function(){
        return this.get('text').replace(/[^-?^\d.e]/, '').stripTags().toFloat();
    },
    number: true
},

@SergioCrisostomo SergioCrisostomo modified the milestones: 1.5.1, 1.5.0 Apr 24, 2014

Member

SergioCrisostomo commented Jun 20, 2014

Good catch! and thank you for this fix.

Member

SergioCrisostomo commented Jul 29, 2014

fixed by bf8b5de

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment