Format number entries in C# |
![]() |
![]() |
![]() |
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; }
|