In PostgreSQL, we can use the TO_CHAR()
function to format numbers in a given format. This includes formatting numbers with commas in the relevant location.
PostgreSQL also has a money
data type, which outputs the value using the current locale. This can include commas in the appropriate place, based on the locale being used.