Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/NSC/Extensions/StringExts.cs
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Net;
using System.Text;
using System.Threading;

namespace NetSwiftClient
{
Expand DownExpand Up@@ -38,6 +39,9 @@ public static object SafeConvert(this string s, Type t, object defaultValue)

public static object SafeConvert(this string s, Type t, Func<object> defaultValueGenerator)
{
// Converting from US numbers formatting
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-us");

if (String.IsNullOrEmpty(s))
return defaultValueGenerator();
if (!t.IsValueType)
Expand Down