Skip to content

Commit a9529bb

Browse files
committed
To (Nuget 1.1.11.3)
1 parent 0e91a46 commit a9529bb

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

Sources/CS/To.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using System.Globalization;
5+
6+
public class To
7+
{
8+
private static NumberFormatInfo GetNumberFormatInfo()
9+
{
10+
NumberFormatInfo Result = new NumberFormatInfo();
11+
12+
Result.NumberDecimalSeparator = ".";
13+
Result.NumberGroupSeparator = " ";
14+
Result.NumberGroupSizes = new int[] { 3 };
15+
16+
return Result;
17+
}
18+
19+
public static Double Double(string Value)
20+
{
21+
Value = Value.Replace(",", ".");
22+
return Convert.ToDouble(Value, GetNumberFormatInfo());
23+
}
24+
25+
public static Decimal Decimal(string Value)
26+
{
27+
Value = Value.Replace(",", ".");
28+
return Convert.ToDecimal(Value, GetNumberFormatInfo());
29+
}
30+
31+
public static string String(decimal Value)
32+
{
33+
return To.String("{0}", Value);
34+
}
35+
36+
public static string String(string Format, double Value)
37+
{
38+
return Value.ToString(Format, GetNumberFormatInfo());
39+
}
40+
41+
public static string String(string Format, Decimal Value)
42+
{
43+
return Value.ToString(Format, GetNumberFormatInfo());
44+
}
45+
}

Sources/ZPF_Basics.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<PackageIconUrl>https://raw.githubusercontent.com/ZeProgFactory/MediaPlayer/master/docs/ZeProgramFactory.Square.BG.png</PackageIconUrl>
1111
<PackageTags>Basics</PackageTags>
1212
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
13-
<Version>1.1.10.3</Version>
13+
<Version>1.1.11.3</Version>
1414
<Description>Basics ( V2 / .Net Standard 2.0 )</Description>
15-
<AssemblyVersion>1.1.10.3</AssemblyVersion>
16-
<FileVersion>1.1.10.3</FileVersion>
15+
<AssemblyVersion>1.1.11.3</AssemblyVersion>
16+
<FileVersion>1.1.11.3</FileVersion>
1717
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1818
<RepositoryUrl>https://github.com/ZeProgFactory/ZPF_Basics</RepositoryUrl>
1919
<RepositoryType>GIT</RepositoryType>

0 commit comments

Comments
 (0)