Skip to content

Instantly share code, notes, and snippets.

@vgashic
Created September 21, 2018 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgashic/80d2aa08db98e8475f1fc9bac18703ff to your computer and use it in GitHub Desktop.
Save vgashic/80d2aa08db98e8475f1fc9bac18703ff to your computer and use it in GitHub Desktop.
using System;
using System.Globalization;
using System.Threading;
public class Program
{
public static void Main()
{
string s = ",3";
string decSeparator = Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator;
s = s.Replace(",", decSeparator).Replace(".", decSeparator);
decimal d = Convert.ToDecimal(s);
Console.WriteLine(d.ToString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment