Converts the string to a double.
Returns null if the string cannot be parsed.
null
Example:
toFloat('3.14'); // 3.14 toFloat('abc'); // null
double? toFloat(String str) => double.tryParse(str.trim());