我有xsd代码,它将LINE_AMOUNT值打印为14,952.59,现在我想将其显示为14,952.59000(小数点后5位)。
如何实现这一目标?
谢谢
答案 0 :(得分:1)
查询1 要么(如果要将当前NLS值用于十进制和千位字符):
SELECT TO_CHAR(
14952.59,
'FM9G999G999G999G990D00000'
)
FROM DUAL
<强> Results 强>:
| TO_CHAR(14952.59,'FM9G999G999G999G990D00000') |
|-----------------------------------------------|
| 14,952.59000 |
查询2 或:
SELECT TO_CHAR(
14952.59,
'FM9,999,999,999,990.00000'
)
FROM DUAL
<强> Results 强>:
| TO_CHAR(14952.59,'FM9,999,999,999,990.00000') |
|-----------------------------------------------|
| 14,952.59000 |
更新:SQL Fiddle
查询3 :
SELECT TO_CHAR(
TO_NUMBER(
'13,214,952.59',
'FM9G999G999G999G990D99999'
),
'FM9G999G999G999G990D00000'
) AS formatted_value
FROM DUAL
<强> Results 强>:
| FORMATTED_VALUE |
|------------------|
| 13,214,952.59000 |
查询4 :
SELECT TO_CHAR(
TO_NUMBER(
'13,214,952.59',
'FM9,999,999,999,990.99999'
),
'FM9,999,999,999,990.00000'
) AS formatted_value
FROM DUAL
<强> Results 强>:
| FORMATTED_VALUE |
|------------------|
| 13,214,952.59000 |
答案 1 :(得分:0)
试试这个,我觉得它对你有用。
select trim(to_char(14952.59,9999999999.99999)) from dual
OUTPUT
14952.59000