I have a table with three columns:
customer_name varchar ,account_type varchar ,current_balance double precision
Example current_balance values:
1200
1500.5
1500
I want them displayed as follows:
1200.00
1500.50
1500.00
I tried the following query:
SELECT to_char(current_balance,'9999999999999999D99') FROM bank;
It formats what I want, but adds space at the beginning. How to solve this? Is there a better way to format?
floating-point formatting postgresql
ungalnanban
source share