Lotus中货币数字转换成人民币大写

首先创建一个数字域,为两位小数。域名Total, 另外一个域为TotalSum 用来显示转换后的结果。
1
TotalSum 中的entering 域中加入如下代码:

******************************************************
Sub Entering(Source As Field)
Dim workspace As New notesuiworkspace
Dim uidoc As notesuidocument
Set uidoc = workspace.currentdocument
Dim lef,rig As String
Dim Cur As String
Cur=/"
万仟佰拾亿仟佰拾万仟佰拾元/"
Dim MyStr As String
Insert=uidoc.fieldgettext(/"totle/")
n=Len(insert)
lef=Left(insert,n-3)
rig=Right(insert,2)
ln=Len(lef)
rn=Len(rig)
For i=1 To ln
MyStr=MyStr+C(Mid(lef,i,1))+Mid(cur,13-ln+i,1)
Next i
MyStr=MyStr+C(Left(rig,1))+/"
/"+C(Right(rig,1))+/"/"
Call uidoc.fieldsettext(/"totalsum/",mystr)
End Sub
************************************************************
在表单中加入自定义函数C():

Function C(S As String) As String
If S=/"1/" Then
C=/"
/"
End If
If S=/"2/" Then
C=/"
/"
End If
If S=/"3/" Then
C=/"
/"
End If
If S=/"4/" Then
C=/"
/"
End If
If S=/"5/" Then
C=/"
/"
End If
If S=/"6/" Then
C=/"
/"
End If
If S=/"7/" Then
C=/"
/"
End If
If S=/"8/" Then
C=/"
/"
End If
If S=/"9/" Then
C=/"
/"
End If
If S=/"0/" Then
C=/"
/"
End If
End Function 

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值