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

Incorrect card highlighted #18

Closed
corlettb opened this issue Jun 24, 2015 · 2 comments
Closed

Incorrect card highlighted #18

corlettb opened this issue Jun 24, 2015 · 2 comments

Comments

@corlettb
Copy link

I've noticed several times that the wrong card is highlighted when the card comes out as a whole number and the others are doubles.

See below for example.

screen shot 2015-06-24 at 21 16 52

At a glance this might have to do with the regex in the below where "." might need to be escaped.

    public double GetNumericalValue(string str)
    {
        // Strip everything except numbers and dots
        var nstr = Regex.Replace(str, "[^0-9.]", "");
        double dvalue = 0;
        try
        {
            dvalue = System.Xml.XmlConvert.ToDouble(nstr);
        }
        catch (Exception)
        {
        }

        return dvalue;
    }
@rembound
Copy link
Owner

What happens is, every character except the allowed characters are stripped. The resulting numbers are: 76.768, 70.3458 and 1720

What I could do is, only take the part before a space and ignore the rest.

@rembound
Copy link
Owner

rembound commented Jul 3, 2015

Added support with the latest release.

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

No branches or pull requests

2 participants