SHARE
TWEET

Untitled

a guest Aug 22nd, 2013 27 Never
  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. }
RAW Paste Data
Top