Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

HtmlTable.Parsers excludes valid character for floats #1145

enigmamf opened this issue Aug 14, 2012 · 2 comments
Milestone

Comments

@enigmamf
Copy link

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
Copy link
Member

Good catch! and thank you for this fix.

@SergioCrisostomo
Copy link
Member

fixed by bf8b5de

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants