PostgreSQL 转换浮点值以使用千位分隔符查看它
PostgreSQL cast float value to see it with thousands separator
我正在 PostgreSQL table 上执行以下查询:
select precio::money,
area
from table
结果如下所示:
price area
.00 6200000000
,300,000,000.00 4800000000
0,000,000.00 3003514620
5,000,000.00 585000000
我想格式化 area
列(浮点型)以使用千位分隔符以提高可读性,这与我对 price
列所做的类似。
有什么建议吗?
这个解决方案对我有用:
select precio::money,
to_char(area, '9G999G999G999')
from table
我正在 PostgreSQL table 上执行以下查询:
select precio::money,
area
from table
结果如下所示:
price area
.00 6200000000
,300,000,000.00 4800000000
0,000,000.00 3003514620
5,000,000.00 585000000
我想格式化 area
列(浮点型)以使用千位分隔符以提高可读性,这与我对 price
列所做的类似。
有什么建议吗?
这个解决方案对我有用:
select precio::money,
to_char(area, '9G999G999G999')
from table