• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

formatting money

I am trying to format a number. According the the convert() documentation: http://msdn.microsoft.com/en-us/library/ms187928.aspx, CONVERT ( data_type [ ( length ) ] , expression [ , style ] ), for type money, style 1 should give me: "Commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 3,510.92."

I have tried: convert(money,earningsAmount,1) and convert(varchar,cast(earningsAmount as money),1)

both give me e.g. 1735.3400 whereas I am looking for 1,735.34

What am I doing wrong?
  • 2
1 Solution
Reza RadCommented:
try like this:

select convert(varchar(max),convert(money,43532423.343,1),1)

Open in new window

jmarkfoleyAuthor Commented:
thanks, that did it! Amazingly complex!
Reza RadCommented:
glad to help


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now