tolikpunkoff

convert . or , number string to double

Sep 13th, 2019
301
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data