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

"View in P4V" doesn't work if system locale is not using . as floating point separator #8

Open
Twifus opened this issue May 24, 2022 · 0 comments

Comments

@Twifus
Copy link

Twifus commented May 24, 2022

P4V version: 2022.1.226.6529
P4VS version: 2021.2.226.2490
Visual Studio version: VS2019 16.11.15

On my computer, the "View in P4V" feature don't work, reporting an invalid string format.
image

It seems the problem comes from this line that cast the P4V.exe version number to double :

double versionnum = Convert.ToDouble(line);

Many users have a system locale that don't use '.' as the floating point separator, and thus parsing of "2022.1" fail.

Just using the en-US locale should be enough to fix the issue:
double versionnum = Convert.ToDouble(line, new CultureInfo("en-US"));

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

1 participant