To add to the first reply, SQL is based on a tiered architecture. The database tier handles all of the database retrieval and data integrity. But nothing else. The data display and formatting is done in presentation layers that get data from the database layer.
What you want is 1960's COBOL in which there a single monolithic program that does computations, data retrieval and display. Look up the PICTURE clause in the DATA DIVISION of a COBOL Program. At this point in your career, you are not fit to do RDBMS; please stop and get an education so your can make better errors and not conceptual ones like this.
Just so you know, FORMAT is 44 times slower than most anything else that you could throw at this problem. MS did us no favors when they coded the FORMAT function. It would be faster to use CONVERT in this case.