xsd格式数字,小数点后5位

xsd format number , 5 decimal places

我有 xsd 代码打印 LINE_AMOUNT 值为 14,952.59,现在我想将其显示为 14,952.59000(小数点后 5 位)。

如何实现?

谢谢

试试这个,我想它对你有用。

select trim(to_char(14952.59,9999999999.99999)) from dual


OUTPUT
14952.59000

SQL Fiddle

查询 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 |