Skip to content

Commit

Permalink
DebugLogConsole parses number inputs using InvariantCulture
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirkula committed Aug 18, 2024
1 parent ae54397 commit 4ace1a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Plugins/IngameDebugConsole/Scripts/DebugLogConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ public static bool ParseChar( string input, out object output )
public static bool ParseFloat( string input, out object output )
{
float value;
bool result = float.TryParse( !input.EndsWith( "f", StringComparison.OrdinalIgnoreCase ) ? input : input.Substring( 0, input.Length - 1 ), out value );
bool result = float.TryParse( !input.EndsWith( "f", StringComparison.OrdinalIgnoreCase ) ? input : input.Substring( 0, input.Length - 1 ), NumberStyles.Float, CultureInfo.InvariantCulture, out value );

output = value;
return result;
Expand All @@ -1139,7 +1139,7 @@ public static bool ParseFloat( string input, out object output )
public static bool ParseDouble( string input, out object output )
{
double value;
bool result = double.TryParse( !input.EndsWith( "f", StringComparison.OrdinalIgnoreCase ) ? input : input.Substring( 0, input.Length - 1 ), out value );
bool result = double.TryParse( !input.EndsWith( "f", StringComparison.OrdinalIgnoreCase ) ? input : input.Substring( 0, input.Length - 1 ), NumberStyles.Float, CultureInfo.InvariantCulture, out value );

output = value;
return result;
Expand All @@ -1148,7 +1148,7 @@ public static bool ParseDouble( string input, out object output )
public static bool ParseDecimal( string input, out object output )
{
decimal value;
bool result = decimal.TryParse( !input.EndsWith( "f", StringComparison.OrdinalIgnoreCase ) ? input : input.Substring( 0, input.Length - 1 ), out value );
bool result = decimal.TryParse( !input.EndsWith( "f", StringComparison.OrdinalIgnoreCase ) ? input : input.Substring( 0, input.Length - 1 ), NumberStyles.Float, CultureInfo.InvariantCulture, out value );

output = value;
return result;
Expand Down

0 comments on commit 4ace1a9

Please sign in to comment.