Vladimir Kirov
Vladimir Kirov

Reputation: 69

SQL format for decimal with comma to indicate decimals, only to digit

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

The number goes without comma to separate 1000's and has a comma to indicate decimals, only to digits.

For Example: 1324,35 (correct) Instead of 1.324,35 (incorrect format) or 1,345.64 (incorrect format)

Upvotes: 1

Views: 9967

Answers (2)

Gordon Linoff
Gordon Linoff

Reputation: 1269813

You need to add an appropriate culture argument to FORMAT(). Many European countries use commas as decimal separators, so something like this works:

select FORMAT(12345.8, '#.00', 'fr-fr')

Upvotes: 3

Hila DG
Hila DG

Reputation: 728

If you're using SQL server 2012 and up, you can use the format function, like in:

 FORMAT (YourColumn, "#,###")

Upvotes: -1

Related Questions