总是在 SQL 中显示小数位?

2022-01-12 00:00:00 sql formatting oracle

我正在处理一个返回数值(货币)的查询.其中一些值是整数,显示为 3、5、2 等,而其他数字则显示为 2.52、4.50 等.

I'm working on a query which returns numeric values (currency). Some of the values are whole numbers and are being displayed as 3, 5, 2 etc whilst other numbers are coming up like 2.52, 4.50 etc.

如何强制 oracle 始终显示小数位?

How can I force oracle to always show the decimal places?

谢谢

推荐答案

TO_CHAR(pAmount, '9,999,999.99');

http://www.techonthenet.com/oracle/functions/to_char.php

http://www.ss64.com/orasyntax/to_char.html

相关文章