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.
13,682 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Erland Sommarskog 110.4K Reputation points MVP
    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

  3. Naomi Nosonovsky 7,856 Reputation points
    2023-09-07T13:56:50.9833333+00:00

    Try

    SELECT FORMAT(100999.99,'C')

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.