VAR Char to Dollar Format

Anonymous
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 | Other
{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 129.1K Reputation points MVP Volunteer Moderator
    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 8,881 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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.