diff --git a/Sources/CS/To.cs b/Sources/CS/To.cs new file mode 100644 index 0000000..30a9966 --- /dev/null +++ b/Sources/CS/To.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Globalization; + +public class To +{ + private static NumberFormatInfo GetNumberFormatInfo() + { + NumberFormatInfo Result = new NumberFormatInfo(); + + Result.NumberDecimalSeparator = "."; + Result.NumberGroupSeparator = " "; + Result.NumberGroupSizes = new int[] { 3 }; + + return Result; + } + + public static Double Double(string Value) + { + Value = Value.Replace(",", "."); + return Convert.ToDouble(Value, GetNumberFormatInfo()); + } + + public static Decimal Decimal(string Value) + { + Value = Value.Replace(",", "."); + return Convert.ToDecimal(Value, GetNumberFormatInfo()); + } + + public static string String(decimal Value) + { + return To.String("{0}", Value); + } + + public static string String(string Format, double Value) + { + return Value.ToString(Format, GetNumberFormatInfo()); + } + + public static string String(string Format, Decimal Value) + { + return Value.ToString(Format, GetNumberFormatInfo()); + } +} diff --git a/Sources/ZPF_Basics.csproj b/Sources/ZPF_Basics.csproj index 3253f5c..7ccc1a5 100644 --- a/Sources/ZPF_Basics.csproj +++ b/Sources/ZPF_Basics.csproj @@ -10,10 +10,10 @@ https://raw.githubusercontent.com/ZeProgFactory/MediaPlayer/master/docs/ZeProgramFactory.Square.BG.png Basics true - 1.1.10.3 + 1.1.11.3 Basics ( V2 / .Net Standard 2.0 ) - 1.1.10.3 - 1.1.10.3 + 1.1.11.3 + 1.1.11.3 MIT https://github.com/ZeProgFactory/ZPF_Basics GIT