Skip to content
This repository was archived by the owner on Jun 17, 2020. It is now read-only.
This repository was archived by the owner on Jun 17, 2020. It is now read-only.

Potential calculation erros in Double.TryParse and Double.Parse with Invariant culture and NumberStyles.Any #31

Open
@AlexanderSemenyak

Description

@AlexanderSemenyak

Issue (example):
Double.Parse("77,65", System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture)

return 7765

Cause: System.Globalization.NumberStyles.AllowThousands
https://stackoverflow.com/questions/46109025/c-sharp-double-tryparse-with-invariantculture-returns-unexpected-result

Sample for fix:
use Public Shared NumberStyleAnyWithoutAllowThousands as NumberStyles = NumberStyles.Any - NumberStyles.AllowThousands

instead NumberStyles.Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions