In Windows Form (C #), I enter my number in the text box and separate the three digits with the following code (for better readability of the number). For example, the:
2500000 => 2,500,000
But I have a problem!
I want to do math operations (addition, multiplication, etc.) on my numbers. And I need to return my number to the first state (2500000) !?
please guide me This is my code:
private void textBox1_TextChanged_1(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
textBox1.Text = "0";
}
textBox1.Text = long.Parse(textBox1.Text.Replace(",", "")).ToString("n0");
textBox1.SelectionStart = textBox1.Text.Length;
}