This commit is contained in:
2024-02-23 06:57:07 -05:00
commit 8fb7082f56
104 changed files with 284139 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tor
{
public class Utility
{
private Utility()
{
}
public static String FormatNumber(double number,int places,bool commas=false)
{
StringBuilder sb = new StringBuilder();
StringBuilder formatString=new StringBuilder();
if (commas&&number>=1000.00) formatString.Append("{0:0,0.");
else formatString.Append("{0:0.");
for(int index=0;index<places;index++)formatString.Append("0");
formatString.Append("}");
if (double.NaN.Equals(number)) sb.Append("N/A");
else sb.Append(String.Format(formatString.ToString(), number));
return sb.ToString();
}
}
}