예제 #1
0
 // by ram babu
 public static void RemoveZerroForLabel(Label l)
 {
     if (l != null)
     {
         if (l.Text == "")
         {
             l.Text = "0";
         }
         if (Convert.ToDecimal(l.Text) == 0)
         {
             l.Text = "";
         }
         else if (Convert.ToDecimal(l.Text) != 0)
         {
             l.Text = Formatting_Text.Insert_Commas(Convert.ToDecimal(l.Text).ToString("0.00"));
         }
     }
 }
예제 #2
0
    public static void RemoveZerroForText(TextBox t)
    {
        if (t != null)
        {
            if (t.Text == "")
            {
                t.Text = "0";
            }

            if (Convert.ToDecimal(t.Text) == 0)
            {
                t.Text = "0";
            }
            else if (Convert.ToDecimal(t.Text) != 0)
            {
                t.Text = Formatting_Text.Insert_Commas(Convert.ToDecimal(t.Text).ToString("0.00"));
            }
        }
    }