Skip to content

Commit

Permalink
To (Nuget 1.1.11.3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeProgFactory committed Nov 9, 2019
1 parent 0e91a46 commit a9529bb
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
45 changes: 45 additions & 0 deletions Sources/CS/To.cs
Original file line number Diff line number Diff line change
@@ -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());
}
}
6 changes: 3 additions & 3 deletions Sources/ZPF_Basics.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<PackageIconUrl>https://raw.githubusercontent.com/ZeProgFactory/MediaPlayer/master/docs/ZeProgramFactory.Square.BG.png</PackageIconUrl>
<PackageTags>Basics</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.1.10.3</Version>
<Version>1.1.11.3</Version>
<Description>Basics ( V2 / .Net Standard 2.0 )</Description>
<AssemblyVersion>1.1.10.3</AssemblyVersion>
<FileVersion>1.1.10.3</FileVersion>
<AssemblyVersion>1.1.11.3</AssemblyVersion>
<FileVersion>1.1.11.3</FileVersion>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/ZeProgFactory/ZPF_Basics</RepositoryUrl>
<RepositoryType>GIT</RepositoryType>
Expand Down

0 comments on commit a9529bb

Please sign in to comment.