WinForms, I have a textbox leave event, in the textbox the user is prompted to add a price example:
He needs to provide the price in the textbox let's say he writes 5 only, the textbox leave event should get him 5.00 and it's working but there is a problem on other computers that use other culture for example in that computer that I encountered the problem Point '.'
this is treated as comma this ','
and if user prompts 5.43
he will get 543,00
not 5.43
or 5
to get 5.00
he will get comma. I need to get for every computer no matter the culture to work only with Point this '.'
here is my code:
decimal number = 0;
if (Decimal.TryParse(textBox20.Text, out number))
{
textBox20.Text = Decimal.Parse(textBox20.Text).ToString("0.00");
}
else
{
textBox20.Text = "0.00";
}