function dx(q)
dim cur as long,yuan as long
dim jiao as integer,fen as integer
dim cnyuan as string, cnjiao as string, cnfen as string
if q = "" then
dx = 0
exit function
end if
cur = round(q * 100)
yuan = int(cur / 100)
jiao = int(cur / 10) - yuan * 10
fen = cur - yuan * 100 - jiao * 10
cnyuan = application.worksheetfunction.text(yuan, "[dbnum2]")
cnjiao = application.worksheetfunction.text(jiao, "[dbnum2]")
cnfen = application.worksheetfunction.text(fen, "[dbnum2]")
dx = cnyuan & "元" &
"整"
d1 = cnyuan & "元"
if fen <> 0 and jiao <> 0 then
dx = d1 & cnjiao & "角"
& cnfen & "分"
if yuan = 0 then
dx = cnjiao & "角" &
cnfen & "分"
end if
end if
if fen = 0 and jiao <> 0 then
dx = d1 & cnjiao & "角"
& "整"
if yuan = 0 then
dx = cnjiao & "角" &
"整"
end if
end if
if fen <> 0 and jiao = 0 then
dx = d1 & cnjiao & cnfen & "分"
if yuan = 0 then
dx = cnfen & "分"
end if
end if
end function