Sorry for the inconvenience, I have a question if possible: For example, suppose we created a program to calculate the average of a subject and entered the test1 point and the test2 point and then the average is displayed, so we need two edits to enter the test1 and test2 and one edit to show the average, and as we know that the test 1or test2 point, for example, if it is 15.5 It means that the point, if it is decimal, will consist of a comma, meaning it cannot be a decimal number that contains two commas, for example 15.15.1, as this is not a decimal number, so my question is: How can I make the user of my program enter only one comma, that is, how do I prevent him from entering several commas In order for the error messages not to appear, I apologize if my explanation was not clear, just what is the code that I write to make users enter only one comma, and where do I write it, for example in the edit itself or in the properties onchange or onkeypress or where exactly??