iv_money
= abs
( iv_money ).
data
: scr
(30) type
c, res
(60) type
c,fen (2
) type c .
data
: len
type
i, c1
type
i, c2
type
i, c3
type
i, c4
type i.
data
: d1 (1
) type
c, d2 (1
) type
c, d3
type i.
data
: digit (2
) type
c, weight (2
) type c.
data
: rule1
(20) type
c value
'零壹貳叄肆伍陸柒捌玖'
.data
: rule2
(30) type
c value
'分角元拾佰仟萬拾佰仟億拾佰仟萬'
.scr
= iv_money *
100.condense scr
no-gaps
.if scr
= '0'
.res
= '零元'
.else
.len
= strlen
( scr ).
c1 = 0.
d1 =
'0'.
clear res
.do len
times
.c1
= c1 + 1.
c2 = len
- c1
.d2
= scr+c2 (1
) .if d2
= '0'
.d3
= 0.else
.d3
= d2
.endif
.digit
= rule1+d3 (1
) .c3 =
( c1
- 1 ) .
weight
= rule2+c3 (1
) .if d2
= '0'
.if c1
= 3.digit
= ''
.elseif c1
= 7.digit
= ''
.if len >
10 .c4
= len
- 10
.if scr+c4 (4
) =
'0000'
.weight
= ''
.endif
.endif
.elseif c1
= 11
.digit
= ''
.elseif d1
= '0'
.digit
= ''
.weight
= ''
.else
.weight
= ''
.endif
.endif
.concatenate digit weight res
into res
.d1
= d2
.enddo
.endif
.len
= strlen
( res
) - 1.
fen
= res+len (1
).if fen <>
'分'
.concatenate res
'整'
into ev_money
.else
.ev_money
= res
.endif
.再分享一下我老師大神的人工智慧教程吧。零基礎!通俗易懂!風趣幽默!還帶黃段子!希望你也加入到我們人工智慧的隊伍中來!
iv_money
= abs
( iv_money ).
data
: scr
(30) type
c, res
(60) type
c,fen (2
) type c .
data
: len
type
i, c1
type
i, c2
type
i, c3
type
i, c4
type i.
data
: d1 (1
) type
c, d2 (1
) type
c, d3
type i.
data
: digit (2
) type
c, weight (2
) type c.
data
: rule1
(20) type
c value
'零壹貳叄肆伍陸柒捌玖'
.data
: rule2
(30) type
c value
'分角元拾佰仟萬拾佰仟億拾佰仟萬'
.scr
= iv_money *
100.condense scr
no-gaps
.if scr
= '0'
.res
= '零元'
.else
.len
= strlen
( scr ).
c1 = 0.
d1 =
'0'.
clear res
.do len
times
.c1
= c1 + 1.
c2 = len
- c1
.d2
= scr+c2 (1
) .if d2
= '0'
.d3
= 0.else
.d3
= d2
.endif
.digit
= rule1+d3 (1
) .c3 =
( c1
- 1 ) .
weight
= rule2+c3 (1
) .if d2
= '0'
.if c1
= 3.digit
= ''
.elseif c1
= 7.digit
= ''
.if len >
10 .c4
= len
- 10
.if scr+c4 (4
) =
'0000'
.weight
= ''
.endif
.endif
.elseif c1
= 11
.digit
= ''
.elseif d1
= '0'
.digit
= ''
.weight
= ''
.else
.weight
= ''
.endif
.endif
.concatenate digit weight res
into res
.d1
= d2
.enddo
.endif
.len
= strlen
( res
) - 1.
fen
= res+len (1
).if fen <>
'分'
.concatenate res
'整'
into ev_money
.else
.ev_money
= res
.endif
.
數字金額轉化為大寫金額
create or replace function fn getmoneytochina p money in number return varchar2 is 功能 數字金額轉化為漢字金額 最大支援金額 9999999999999999.99 支援千萬億的任何金額 小數點支援2位 type m...
數字金額轉化為中文大寫
數字金額轉換成中文大寫金額的函式 string int num 要轉換的小寫數字或小寫字串 return 大寫字母 小數字為兩位 function num to rmb num i 0 c while 1 else 每次將最後一位數字轉化為中文 p1 substr c1,3 n,3 p2 subst...
pb 數字轉化為大寫金額
功能描述 獲取乙個金額的大寫格式 引數及返回值說明 dsum decimal型別 returnvaleu string型別 boolean digit false int i,n,length string temp,temp1,temp2,upper1,upper2,upper upper1 零壹...