SHARE
TWEET

convert . or , number string to double

tolikpunkoff Sep 13th, 2019 80 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top