日期:2014-05-17 浏览次数:20820 次
CREATE OR REPLACE FUNCTION money_to_chinese (money IN VARCHAR2)
RETURN VARCHAR2
IS
c_money VARCHAR2 (12);
m_string VARCHAR2 (60) := '分角圆拾佰仟万拾佰仟亿';
n_string VARCHAR2 (40) := '壹贰叁肆伍陆柒捌玖';
b_string VARCHAR2 (80);
n CHAR;
len NUMBER (3);
i NUMBER (3);
tmp NUMBER (12);
is_zero BOOLEAN;
z_count NUMBER (3);
l_money NUMBER;
l_sign VARCHAR2 (10);
BEGIN
l_money := ABS (money);
IF money < 0
THEN
l_sign := '负';
ELSE
l_sign := '';
END IF;
tmp := ROUND (l_money, 2) * 100;
c_money := RTRIM (LTRIM (TO_CHAR (tmp, '999999999999')));
len := LENGTH (c_money);
is_zero := TRUE;
z_count := 0;
i := 0;
WHILE i < len
LOOP
i := i + 1;
n := SUBSTR (c_money,
i,
1