Reputation: 131
How can numbers converted so that they have n decimal places?
I want to convert all numbers of a column so that they have three decimal places. For example the query result should look like this
Amount
3.000
2.511
3.200
...
Upvotes: 0
Views: 612
Reputation: 12494
Please see this page: https://www.postgresql.org/docs/current/functions-formatting.html
select to_char(amount, '999D999') as "Amount"
from your_table;
Upvotes: 1