Here's a modified version of qwerty's
/numonly:
alias xnumonly {
; /xnumonly <dialog> <id>
var %a = $did($1,$2), %s = $did($1,$2,1).selstart, %l = $mid(%a,%s,1)
if $regex(%l,[^\d.\x2C]) { did -ra $1-2 $remove(%a,%l) | did -c $1-2 1 %s }
}
(see the original link above for instructions on how to use it)
Note: numbers that contain commas are not recognized by mIRC for mathematical operations.