Skip to content
Advertisement

Tag: number-formatting

How to format a number in thousands in SQL

I’m trying to format a number like 238350.50 into “238” with SQL. I round to the nearest thousend using ROUND(number_x, -3) and it works fine but I can’t get rid of the hundreds digits. A few more examples of how the formatting should work: 499.99 becomes 0 500 becomes 1 1250 becomes 1 22500 becomes 23 231600 becomes 232 etc.

Advertisement