1 2 3 4 5
import isFloat from './isFloat'; export default function toFloat(str) { if (!isFloat(str)) return NaN; return parseFloat(str); }