sql - 总是在 SQL 中显示小数位?

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

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

谢谢

最佳答案

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

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

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

https://stackoverflow.com/questions/799151/

相关文章:

string - 在包含花括号的字符串上使用 -f 运算符

sql-server - SQL Server 2008 : how to format the o

r - 用 R 定义 Excel 的列宽

intellij-idea - 如何阻止 IntelliJ IDEA 从 .properties 文

netbeans - 更改netbeans中自动突出显示的变量名的突出显示颜色?

vim - 如何在 Vim 中插入对齐文本列所需的可变数量的空格?

html - html属性和值之间的空格?

c# - 我应该使用 ToString() 还是 GetDateTimeFormats() 来格式化

.net - 文化不可变对象(immutable对象) ToString()

algorithm - 需要一种算法来拆分一系列数字