private static SchemaAndValue parseAsNumber(String token) {
            // Try to parse as a number ...
            BigDecimal decimal = new BigDecimal(token);
            SchemaAndValue exactDecimal = parseAsExactDecimal(decimal);
            float fValue = decimal.floatValue();
            double dValue = decimal.doubleValue();
            if (exactDecimal != null) {
                return exactDecimal;
            } else if (fValue != Float.NEGATIVE_INFINITY && fValue != Float.POSITIVE_INFINITY
                    && decimal.scale() != 0) {
                return new SchemaAndValue(Schema.FLOAT32_SCHEMA, fValue);
            } else if (dValue != Double.NEGATIVE_INFINITY && dValue != Double.POSITIVE_INFINITY
                    && decimal.scale() != 0) {
                return new SchemaAndValue(Schema.FLOAT64_SCHEMA, dValue);
            } else {
                Schema schema = Decimal.schema(decimal.scale());
                return new SchemaAndValue(schema, decimal);
            }
        }
Convert the specified value with the desired floating point type.

@param value  the value to be converted; may not be null
@param schema the schema for the current value type; may not be null
@param error  any previous error that should be included in an exception message; may be null
@return the double value after conversion; never null
@throws DataException if the value could not be converted to a double
connect/api/src/main/java/org/apache/kafka/connect/data/Values.java