Skip to content

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

@Twifus

Description

@Twifus

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"));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions