Refactoring convert_fp_number.