To change the results to numbers, you would use a conversion function. In SQL, it might be CAST, but every database language will have something.
So, in simplified terms (but not actual as I'm too lazy to look up the syntax):
CAST (A, number) > CAST (B, number)