I write function about add 0 for use to add decimal place in string format like this
Function String DtoS_ (decimal value ,int decimalplace)
{
decimal result = value;
String format = ""#,##0";
if(decimalplace> 0)
{
format += ".";
for( int i =0;i<decimalplace;i++)
{
format +="0";
}
}
return result.ToString(format); //e.g. "#,##0.00"
}
I want to know that is there other ways/trick to iteration that don't need to use for loop or while loop above , Thanks in advance.