C# class StringExtentions

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


public static partial class StringExtentions
{

public static string strToN0(this string Deger)
{
return String.Format("{0:N0}", Convert.ToDecimal(Deger));
}

public static string strToN2(this string Deger)
{
return String.Format("{0:N2}", Convert.ToDecimal(Deger));
}

public static string strToP0(this string Deger)
{
return String.Format("{0:P0}", Convert.ToDecimal(Deger));
}
public static string strToP2(this string Deger)
{
return String.Format("{0:P2}", Convert.ToDecimal(Deger));
}

public static string strToC0(this string Deger)
{
return String.Format("{0:C0}", Convert.ToDecimal(Deger));
}
public static string strToC2(this string Deger)
{
return String.Format("{0:C2}", Convert.ToDecimal(Deger));
}

}

Yorumlar