Created
September 21, 2018 12:53
-
-
Save vgashic/80d2aa08db98e8475f1fc9bac18703ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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