SQL Server format decimal places with commas

后端 未结 5 1150
天涯浪人
天涯浪人 2020-12-10 03:43

How can I convert the decimal values to have some commas?

this Helps me. But my problem the decimal places are set to 2 only..I want the decimal to be 2, 3, or 4..ex

5条回答
  •  情深已故
    2020-12-10 04:10

    From a related SO question: Format a number with commas but without decimals in SQL Server 2008 R2?

    SELECT CONVERT(varchar, CAST(1112 AS money), 1)
    

    This was tested in SQL Server 2008 R2.

提交回复
热议问题