I have a table with 3 columns:
customer_name varchar
,account_type varchar
,current_balance double precision
Example values for current_balance:
1200 1500.5 1500
I want them to display like this:
1200.00 1500.50 1500.00
I tried the following query:
SELECT to_char(current_balance,'9999999999999999D99')
FROM bank;
It formats the way I want but adds a space at the beginning. How to solve this? Is there a better way to format?
You can use
trimto remove the extra spaces. With no arguments, it removes only spaces.