Breadcrumbs

Home Web Development Format number entries in C#
Format number entries in C# PDF Print E-mail
Written by Administrator   

To format number or numerical user entries use the below C# code:

 

 

try

{

 

convyfee = Convert.ToDouble(ConvyFee.Text);

ConvyFee.Text = String.Format(new System.Globalization.CultureInfo(""), "{0:N2}", convyfee);

errorBlock4.Text = string.Empty;

errorBlock4.Foreground = Brushes.Black;

}

catch

{

errorBlock4.Text = "Please enter valid amount";

errorBlock4.Foreground = Brushes.Red;

}