Skip to content
Advertisement

Remove Trailing Zeros when Casting to Money

How to remove the zeros

  select CONVERT(varchar, CAST( -3563338 AS money), 1)

Output

-3,563,338.00

Expected Output

-3,563,338

Advertisement

Answer

Use FORMAT:

SELECT FORMAT(-3563338,'#,###,##0')

-3,563,338

The money type output includes a decimal component for change. But, since you don’t want to see that it might be easier to just use FORMAT instead.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement