I would like to know how to display two decimal places when we type a value(money) in a text box.
private void txtAmountRecieved_TextChanged(object sender, EventArgs e)
{
txtAmountRecieved.Text = Convert.ToDouble(txtAmountRecieved.Text)
.ToString("#,0.00");
}
I tried above code. But when I type 1 value in textbox, cursor became in-front of value 1. So I cant type continuously in this textbox without interupt. And also an error occurred when I insert this value to database, which is
Input string was not in a correct format.
So how to solve this?