crude implementation of to_num "method" using format strings