Improved conversion to float