Hi
My last question about checking a textbox for integer or double.
An easier way is to use markedtextbox. But Is it a good option when i don't know how many digits and how many decimals the number will have?
Thanks
Hi
My last question about checking a textbox for integer or double.
An easier way is to use markedtextbox. But Is it a good option when i don't know how many digits and how many decimals the number will have?
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sachin SinghPosted Jan 30, 2022, 6:30 PM
Valerie MeunierPosted Jan 30, 2022, 9:46 PM
Valerie MeunierPosted Jan 30, 2022, 7:04 PM
Thanks, but sorry, i have still '455' in a label when I enter 45.5 in the textbox or '5' when entering '0.5':
private void button1_Click(object sender, EventArgs e)
{
string textboxValue = textBox1.Text;
decimal valueDec = decimal.Parse(textboxValue);
label2.Text = valueDec.ToString();
}
Valerie MeunierPosted Jan 30, 2022, 6:05 PM
Sachin SinghPosted Jan 30, 2022, 5:35 PM
NumericUpDown.DecimalPlacesproperty supports up to 99 decimal places.