XmlHelper.cs 874 B

123456789101112131415161718192021222324252627282930
  1. using System.Globalization;
  2. namespace MuchInfo.Chart.Infrastructure.Helpers
  3. {
  4. public class XMLHelp
  5. {
  6. public XMLHelp()
  7. {
  8. }
  9. public static float ParseSingle(string txt)
  10. {
  11. string text = txt.Replace(",", ".");
  12. return float.Parse(text, CultureInfo.InvariantCulture.NumberFormat);
  13. }
  14. public static double ParseDouble(string txt)
  15. {
  16. string text = txt.Replace(",", ".");
  17. return double.Parse(text, CultureInfo.InvariantCulture.NumberFormat);
  18. }
  19. public static string NumToString(float aNum)
  20. {
  21. return aNum.ToString(CultureInfo.InvariantCulture.NumberFormat);
  22. }
  23. public static string NumToString(double aNum)
  24. {
  25. return aNum.ToString(CultureInfo.InvariantCulture.NumberFormat);
  26. }
  27. }
  28. }