Advertisement
tolikpunkoff

convert . or , number string to double

Sep 13th, 2019
904
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.26 KB | None | 0 0
  1. using System.Globalization;
  2. //...
  3.  
  4. public static double ToDouble(string Number)
  5. {
  6.     Number = Number.Replace(',', '.');
  7.     NumberFormatInfo format = new NumberFormatInfo();
  8.     format.NumberDecimalSeparator = ".";
  9.     return Convert.ToDouble(Number, format);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement