Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 22nd, 2013  |  syntax: None  |  size: 0.50 KB  |  views: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
  2.        
  3. String.Format(CultureInfo.InvariantCulture, "{0:0.####},{1:0.####}", x)
  4.        
  5. public string ToInvariantString(this IFormattable source, string format)
  6. {
  7.     return source.Format(format, CultureInfo.InvariantCulture);
  8. }
  9.        
  10. public string ToInvariantString<T>(this T source, string format)
  11.     where T : IFormattable
  12. {
  13.     return source.Format(format, CultureInfo.InvariantCulture);
  14. }
clone this paste RAW Paste Data