问个问题,我有个字段a,存储的是金额,怎么让小数点后面保留4位小数啊,不足4位的补0

解决方案 »

  1.   

    select to_char(123.13,'FM9999999999999999999.0000') a from dual
      

  2.   

    select to_char(123,'FM9999999999999999999.0000') a from dual------------------
      A
    1 123.0000
      

  3.   


    SQL> create table test_hyx(n number(16,4));Table createdSQL> insert into test_hyx values (44.23);1 row insertedSQL> commit;Commit completeSQL> select * from test_hyx;                 N
    ------------------
               44.2300SQL> drop table test_hyx;Table droppedSQL>