Skip to content

Commit

Permalink
Merge pull request #8 from fel88/main
Browse files Browse the repository at this point in the history
parse double fix
  • Loading branch information
brettfo authored Sep 30, 2022
2 parents d2ba053 + c8cb07e commit 46b4714
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/IxMilia.Iges/IgesParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public static class IgesParser
{
public static bool TryParseDouble(string s, out double result)
{
return double.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out result);
return double.TryParse(s.ToLower().Replace('d', 'e'), NumberStyles.Float, CultureInfo.InvariantCulture, out result);
}

public static double ParseDoubleOrDefault(string s, double defaultValue)
Expand All @@ -21,7 +21,7 @@ public static double ParseDoubleOrDefault(string s, double defaultValue)

public static double ParseDoubleStrict(string s)
{
return double.Parse(s, NumberStyles.Float, CultureInfo.InvariantCulture);
return double.Parse(s.ToLower().Replace('d', 'e'), NumberStyles.Float, CultureInfo.InvariantCulture);
}

public static bool TryParseInt(string s, out int result)
Expand Down

0 comments on commit 46b4714

Please sign in to comment.