System.Windows.Forms.TextBoxDoubleB.ParseValue C# (CSharp) Method

ParseValue() private method

private ParseValue ( String txtValue ) : void
txtValue String
return void
        private void ParseValue(String txtValue)
        {
            Double tmpValue = 0;

            if(Double.TryParse(txtValue, out tmpValue))
            {
                if(Digits != null)
                {
                    tmpValue = Math.Round(tmpValue, (Int32)Digits);
                }

                m_Value = tmpValue;

                if (!String.IsNullOrEmpty(Format))
                {
                    this.Text = tmpValue.ToString(Format);
                }
                else if(Digits != null)
                {
                    this.Text = tmpValue.ToString(String.Format("F{0}", Digits));
                }
                else
                    this.Text = tmpValue.ToString();
            }
            else
            {
                m_Value   = DefaultValue;
                this.Text = DefaultValue.ToString();
            }
                
        }
    }