more convenient float conversion function