We have product costs entered into custom Woocommerce fields. But to use the values in queries, we need to ensure only numbers have been entered:
This function looks good:
https://forums.mysql.com/read.php?60,599995,599995
create function isnumeric(val varchar(1024)) returns tinyint(1) deterministic return val regexp '^(-|\\+)?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+|[0-9]+)$';