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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Jan 30, 2022, 1:30 PM EST
Valerie MeunierRank #1,527 · 1K reputationPosted Jan 30, 2022, 1:05 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Jan 30, 2022, 12:35 PM EST
NumericUpDown.DecimalPlacesproperty supports up to 99 decimal places.Valerie MeunierRank #1,527 · 1K reputationPosted Jan 30, 2022, 2:04 PM EST
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 MeunierRank #1,527 · 1K reputationPosted Jan 30, 2022, 4:46 PM EST