if Key in [',', '.'] then Key := DecimalSeparator; if not (Key in ['0'..'9',DecimalSeparator, #8]) then Key := #0; //Спасибо Aristarh Dark за уместное напоминание:)