procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: char); begin if key in [',', '.'] then Key := DecimalSeparator; end;