Sample Header Ad - 728x90

Best way to put commas into large numbers

13 votes
2 answers
28617 views
I've started a new job and it involves looking at a bunch of big numbers. Is there an easy way to add commas to an int or decimal field to make it readable? For example, SQL Server outputs the column on the left, but for my own sanity, I need it to look like the one on the right: 2036150 -> 2,036,150 ...or would I have to write some heinous left(right(vandalized_data),6),3) + ',' + right(left(vandalized_data),6),3) function? The perfect thing would be commas in the display grid, then plain integers in the output.
Asked by James (2668 rep)
Sep 5, 2018, 05:57 PM
Last activity: Dec 27, 2022, 05:08 PM