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

"Input string was not in a correct format" error #10

Open
xward opened this issue Jul 22, 2016 · 1 comment
Open

"Input string was not in a correct format" error #10

xward opened this issue Jul 22, 2016 · 1 comment
Assignees
Labels

Comments

@xward
Copy link

xward commented Jul 22, 2016

This works :

$ ./FakeGPS -s 50,63
The following location has been set in the driver's registry settings:
Lat:    50
Long:   63

This doesn't :

$ ./FakeGPS -s 50.0,63
ZOMG, we got this error:
Input string was not in a correct format.
Send feedback plz!

So here is my feedback :)

After loking into the code in GeolocationHelper.cs I can see that the regexp went ok but it crash on the Convert.ToDouble method call throwing a FormatException.

After a few digging I found that :
windows 10 parameter > Region >Additionnal Settings >Number > and changed the decimal symbol seprator to "." (from ",")

It fixed the problem, I am in French number format setting, and the lovely Convert.ToDouble method seems to use it.

Two different ideas to solve this (to avoid being dependant of locals) :

  • force convert.toDouble to use "." as seprator in any case.
  • use only integer, where 51.51786,-0.102216 become 5151786 102216 as arguments
@juliankay juliankay self-assigned this Jul 23, 2016
@juliankay juliankay added the bug label Jul 23, 2016
@juliankay
Copy link
Owner

Well spotted, the fix should be to add InvariantCulture to Convert.ToDouble - I've pushed a fix, feel free to try it out and let me know.

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

No branches or pull requests

2 participants