How to convert float to varchar in SQL Server

Try using the STR() function.

SELECT STR(float_field, 25, 5)

STR() Function


Another note: this pads on the left with spaces. If this is a problem combine with LTRIM:

SELECT LTRIM(STR(float_field, 25, 5))

Leave a Comment