Tables: Fixed sort ordering of formatted numbers

Fixes #5888