Alternative fix for RT#86592

Here is alternative fix for RT#86592, which uses Scalar::Util looks_like_number to do not change the output.

B is still used for tests.