oracle改进之将阿拉伯数字转换成中文数字
2017-05-12 08:57
381 查看
本博客是自己在学习和工作途中的积累与总结,仅供自己参考,也欢迎大家转载,转载时请注明出处
http://www.cnblogs.com/king-xg/p/6839738.html
将阿拉伯数字转换成中文汉字,方法自定义函数
create or replace function formate(val in number) return varchar2 is res varchar2(6); begin if val=1 then res:='一'; elsif val=2 then res:='二'; elsif val=3 then res:='三'; elsif val=4 then res:='四'; elsif val=5 then res:='五'; elsif val=6 then res:='六'; elsif val=7 then res:='七'; elsif val=8 then res:='八'; elsif val=9 then res:='九'; elsif val=10 then res:='十'; elsif val=11 then res:='十一'; elsif val=12 then res:='十二'; elsif val=13 then res:='十三'; elsif val=14 then res:='十四'; elsif val=15 then res:='十五'; elsif val=16 then res:='十六'; elsif val=16 then res:='十七'; elsif val=16 then res:='十八'; elsif val=16 then res:='十九'; elsif val=16 then res:='二十'; elsif val=16 then res:='二十一'; elsif val=16 then res:='二十二'; elsif val=16 then res:='二十三'; elsif val=16 then res:='二十四'; elsif val=16 then res:='二十五'; elsif val=16 then res:='二十六'; elsif val=16 then res:='二十七'; elsif val=16 then res:='二十八'; elsif val=16 then res:='二十九'; elsif val=16 then res:='三十'; elsif val=16 then res:='三十一'; elsif val=16 then res:='三十二'; elsif val=16 then res:='三十三'; elsif val=16 then res:='三十四'; elsif val=16 then res:='三十五'; elsif val=16 then res:='三十六'; elsif val=16 then res:='三十七'; elsif val=16 then res:='三十八'; elsif val=16 then res:='三十九'; elsif val=16 then res:='四十'; elsif val=16 then res:='四十一'; elsif val=16 then res:='四十二'; else res:=''; end if; return res; end;
如果还有延展,就往后叠加elsif即可。
相关文章推荐
- 将中文大写数字(从一到九十九)转换为阿拉伯数字
- 一个将阿拉伯数字转换成中文大写的最简单算法
- 报表上金额由阿拉伯数字转换成中文大写
- C#实现的【阿拉伯数字转换成中文大写金额】代码(原创)
- 金额阿拉伯数字转换为中文的存储过程
- 金额阿拉伯数字转换为中文的存储过程
- 一个将阿拉伯数字转换成中文大写的好算法【原创】(C#)
- 报表上金额由阿拉伯数字转换成中文大写
- 报表上金额由阿拉伯数字转换成中文大写
- sql server 中的金额阿拉伯数字转换为中文的自定义函数
- 金额阿拉伯数字转换为中文的存储过程
- 将阿拉伯数字转换成中文大写的函数(javascript)
- 用C#将任意位整数阿拉伯数字转换成中文大写
- 使用C#实现阿拉伯数字到大写中文的转换
- 使用C#实现阿拉伯数字到大写中文的转换-第二种方法
- ms sql server 中的金额阿拉伯数字转换为中文的自定义函数
- 将阿拉伯数字日期转换为中文数字日期格式(ASP)
- 生成随机编码 / SQL语句导入导出大全 //金额阿拉伯数字转换为中文的自定义函数
- 使用C#实现阿拉伯数字到大写中文的转换
- 一个将阿拉伯数字转换成中文大写的算法[C#]