It can be easy to forget that the T-SQL FORMAT()
function provides locale-aware formatting. Locale-aware means that the locale can affect the results. In other words, the exact output you get will depend on the locale.
By default, the function uses the language of the current session to determine the locale. However, this can be overridden by passing a “culture” argument to the function. Doing this allows you to provide results for a particular locale without having to change the language of the current session.
This article contains examples of how locale can affect the results when using the FORMAT()
function in SQL Server.