Skip to content

Commit

Permalink
use current Culture for parsing numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
jittuu committed May 23, 2012
1 parent 002cf9c commit a449bb7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions NSupport/StringToNumberConversion.cs
Expand Up @@ -45,7 +45,7 @@ public static class StringToNumberConversion {
public static int ToInt32(this string source) {
Guard.ArgumentNotNull("source", source);

return int.Parse(source);
return int.Parse(source, NumberFormatInfo.CurrentInfo);
}

/// <summary>
Expand Down Expand Up @@ -96,7 +96,7 @@ public static class StringToNumberConversion {
public static long ToInt64(this string source) {
Guard.ArgumentNotNull("source", source);

return long.Parse(source);
return long.Parse(source, NumberFormatInfo.CurrentInfo);
}

/// <summary>
Expand Down Expand Up @@ -147,7 +147,7 @@ public static class StringToNumberConversion {
public static double ToDouble(this string source) {
Guard.ArgumentNotNull("source", source);

return double.Parse(source);
return double.Parse(source, NumberFormatInfo.CurrentInfo);
}

/// <summary>
Expand Down Expand Up @@ -198,7 +198,7 @@ public static class StringToNumberConversion {
public static decimal ToDecimal(this string source) {
Guard.ArgumentNotNull("source", source);

return decimal.Parse(source);
return decimal.Parse(source, NumberFormatInfo.CurrentInfo);
}

/// <summary>
Expand Down

0 comments on commit a449bb7

Please sign in to comment.