convert float into varchar in SQL server without scientific notation

前端 未结 13 1409
被撕碎了的回忆
被撕碎了的回忆 2020-12-01 13:46

convert float into varchar in SQL server without scientific notation and trimming decimals.

for Ex:

i have float value 1000.2324422, then it

13条回答
  •  感动是毒
    2020-12-01 14:22

    I have another solution since the STR() function would result some blank spaces, so I use the FORMAT() function as folowing example:

    SELECT ':' + STR(1000.2324422), ':' + FORMAT(1000.2324422,'##.#######'), ':' + FORMAT(1000.2324422,'##')
    

    The result of above code would be:

    :      1000 :1000.2324422   :1000
    

提交回复
热议问题