This function can be used to convert almost any numeric expression (such as an int, a float or a numeric etc.) to a nicely formatted varchar that includes thousand delimiters and the desired number of decimals.
If the desired number of decimals is given as a negative value then the function will behave similar to round() in that the returned value will be an integer rounded to a multiple of 10 or 100 or 1000 etc.
Note that while this function does not take culture codes into consideration, the built-in FORMAT
function does:
SELECT FORMAT(471117.456, 'N2', 'en-US');
The string representation of the numeric expression.