VAR Char to Dollar Format

Lauren Sloan 0 Reputation points
2023-09-06T19:32:31.7033333+00:00

I have a column totalAmount and want to convert so that the amount is in US Dollar format.

Example: 9729.20 and I want it to read $9729.20 in display.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
10,959 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 87,431 Reputation points
    2023-09-06T21:17:26.9733333+00:00
    SELECT concat('$', TotalAmount) FROM tbl
    

    However, normally you do formatting like this in the presentation layer.

    0 comments No comments

  2. Naomi 7,361 Reputation points
    2023-09-07T13:56:50.9833333+00:00

    Try

    SELECT FORMAT(100999.99,'C')

    0 comments No comments