数字转成用英文表示的方法
SelectTo_Char(To_Date('1312324','j'),'jsp')FromDual; onemillionthreehundredtwelvethousandthreehundredtwenty-four j从耶酥日开始的累计天数,jsp的含义出自那里,在oracle官方文档库里没有。 另附上char<->number,char<->date的官方格式,希望对大家有所帮助。 char<->number ,分隔符(一般千位) .小数点 $美圆符号前导 00999前导0(5位)length(to_char(12,'000'))=4 9990后缀0(5位) 99999前导空格(5位)length(to_char(12,'999'))=4 B CC999国际标准货币符号to_char(0.122,'C90.99')='CNY0.12' D99D99小数标记,默认为"." EEEE0.0EEEE科学计数发(必须4个E或e)to_char(0.122,'0.9eeee')='1.2E-01' FMfm90.9无前导后缀空格to_char(.122,'FM90.99')='0.12' G9G999分隔符(默认位",")to_char(1234,'9g999')='1,234' LL9999人民币代码to_char(1234,'fmL99,999')='RMB1,234' Mi999Mi符号后置to_char(1234,'fm999,999mi')='1,234-' PR999PR括号表示负数to_char(-1234,'fm999,999pr')='<1,234>' RNRN|rn罗马数字to_char(12,'fmRN')='XII'(1<=n<=3999) S9999S显示正负号to_char(-12,'FM999S')='12-' s9999to_char(12,'FMs999')='+12' TMTM UU9999欧圆代码to_char(12,'FMu990')='RMB12'与Nls_Dual_Currency有关 V99V99扩大10的n倍to_char(123,'fm999v9990')='1230000' XXXXX十六进制to_char(1234,'FmXXXX')='4D2' to_char(123.678,'999,999.9999')='123.6780' to_char(0.022,'999.000')='.022' to_char(123.678,'000,000.0000')='000,123.6780' to_char(0.02,'000.999')='000.020' to_char(123.678,'000,000.00')='000,123.68' to_char(123.678,123.678,'99')='###'Ora-12702 to_char(123.678,'$999,00')='$1,24' ----------------------------------------------------------------------------------------------- char<->date -,.;:间隔符to_char(sysdate,'yyyy-mm/ss.hh24;mi:ss')='2004-10/38.21;34:38' "text"to_char(Sysdate,'yyyy"年"mm"月"dd"日"')='2004年10月26日' AD|A.D.|BC|B.C.公元(前)to_char(Sysdate,'B.c.yyyy"年"')='公元2004年' CC|SCC世纪to_char(Sysdate,'Scc"世纪"yyyy.mm')='21世纪2004.10' 在21世纪仅用两位表示20世纪的时间 Y,YYY|YYY|YY|Y年to_char(Sysdate,'yy')='04' IYYY|IYY|IY|I年(ISO)to_char(Sysdate,'Iyy')='004' RR|RRRRto_date('80','rr')=1980.10.01默认月为当前月的首日 to_date('80','yy')=2080.10.01 Year|SYear英文年to_char(Sysdate,'Year')='twothousandfour' to_char(Sysdate,'SYear')='TwoThousandFour' Q季度(1-4)to_char(Sysdate,'yyyy.mm"第"q"季度"')='2004.10第4季度' MM月份(01-12) Month|Mon月份to_char(Sysdate,'yyyy.mon.ddqiwdy')='2004.10月.26444星期二' RM罗马月份to_char(Sysdate,'yyyy.mmRm')='2004.10X' IW周数(1-53)to_char(Sysdate,'yyyy.mm.dd"第"iW"周"')='2004.10.26第44周' WW|W周数 Day|Dy星期to_char(Sysdate,'yyyy.mm.ddDay')='2004.10.26星期二' D星期(1-7)to_char(Sysdate,'D')='3'星期二 DD天(1-31)to_char(Sysdate,'yyyy.mm.dd')='2004.10.26' DDD天(1-366)to_char(Sysdate,'yyyy.mm.ddddd')='2004.10.26300' J耶苏日to_char(Sysdate,'j')='2453305'自BC14712年算起 AM|A.M.|PM|P.M.上(下)午to_char(Sysdate,'AMhh24:mi:ss')='下午21:50:57' HH|HH12小时(1-12)to_char(Sysdate,'aMhh:mi:ss')='下午10:08:23' HH24小时(0-23)to_char(Sysdate,'P.M.hh:mi:ss')='下午10:11:04' Mi分钟(0-59) SS秒(0-59) SSSSS秒(0-86399)to_char(Sysdate,'hh24:mi:sssssss')='22:35:5981359'自零时累计值 TZD|TZH|TZM|TZR时区 E|EE|FF(1..9)|X