Refactored: function to convert float to String