function GETDXRMB(money:string):string;
var
i,j:integer;
Numcount,Dotcount,stemp,stemp1,stemp2,sFinal:string;
begin
aString[0]:= '零';
aString[1]:= '壹';
aString[2]:= '贰';
aString[3]:= '叁';
aString[4]:= '肆';
aString[5]:= '伍';
aString[6]:= '陆';
aString[7]:= '柒';
aString[8]:= '捌';
aString[9]:= '玖';
Numcount:=money;
i:=pos('.',Numcount);
if i<>0 then
begin
do
tcount:=copy(Numcount,i+1,length(Numcount)-1);
numcount:=copy(numcount,1,i-1);
if (dotcount<>'00')and (dotcount<>'0') then
begin
if (length(dotcount)=2) and (strtoint(copy(dotcount,2,1))<>0) then
do
tcount:= aString[strtoint(copy(Dotcount, 1, 1))]+'角'+aString[strtoint(copy(Dotcount, 2, 1))]+'分'
else
do
tcount:= aString[strtoint(copy(Dotcount, 1, 1))]+'角'
end
else
do
tcount:='';
end;
if length(numcount)> 8 then
stemp:=copy(numcount,1,length(numcount)-8);//亿
if (stemp<>'') and (strtoint(stemp)>0) then
sFinal:=sFinal+GetNumstring(strtoint(stemp))+'亿';
if Length(Numcount) > 4 then
sTemp:= copy(Numcount,1,length(numcount)-4);
//万
if (sTemp <> '') and (strtoint(sTemp) <> 0) then
sFinal:= sFinal+ GetNumString(strtoint(sTemp))+'万';
sFinal:= sFinal + GetNumString(strtoInt(copy(Numcount,1,length(numcount))));
sTemp:='';
j:=Length(sFinal);
i:=1;
while i<jdo
begin
sTemp1:=copy(sFinal,i,2);
if i<j then
sTemp2:=copy(sFinal,i+2,2);
if sTemp1<>'零' then
sTemp:= sTemp + sTemp1
else
if (sTemp<>'') and (sTemp1='零') and (sTemp2<>'万') and (sTemp2<>'亿') and (sTemp2<>'零') and (sTemp2<>'') and (i<>1) and (i<Length(sFinal)) then
sTemp:=sTemp+sTemp1;
i:=i+2;
end;
sFinal:= sTemp + '元';
ifdo
tcount <> '' then
sFinal:=sFinal+Dotcount
else
sFinal:=sFinal+'整';
GETDXRMB:=sFinal;
end;
function getNumstring(inum:integer):string;
var
i:integer;
s1temp,stemp,sreturn:string;
begin
aString[0]:='零';aString[1]:='壹';
aString[2]:='贰';aString[3]:='叁';
aString[4]:='肆';aString[5]:='伍';
aString[6]:='陆';aString[7]:='柒';
aString[8]:='捌';aString[9]:='玖';
s1temp:='0000'+inttostr(iNum);
sTemp:=copy(s1temp,length(inttostr(inum))+1,4);
for i:=1 To 4do
begin
if copy(sTemp,i,1) = '0' then
begin
sReturn:= sReturn+'零';
end
else
begin
sReturn:=sReturn+aString[strtoInt(copy(sTemp,i,1))];
case i of
1: sReturn:= sReturn+'仟';
2: sReturn:= sReturn+'佰';
3: sReturn:= sReturn+'拾';
end;
end;
end;
GetNumString:=sReturn;
end;
procedure TRuku.FormShow(Sender: TObject);
begin
ComboBox6.Clear;
ComboBox6.Items.Assign(Printer.Printers);
if ComboBox6.Items.CommaText='' then
Application.MessageBox('没有安装打印机!','提示',1);
DateTimePicker1.date:=Now-30;
DateTimePicker2.date:=Now;
ADO_Query.Close;
ADO_Query.SQL.Clear;
ADO_Query.SQL.Add('select a.organization_id zzid,substr(b.name,1,2) zzname');
ADO_Query.SQL.Add('from HR_ORGANIZATION_UNITS_V b, Hr_Organization_Information_v a');
ADO_Query.SQL.Add('where b.organization_id=a.organization_id ');
ADO_Query.SQL.Add('and a.org_information1 like ''OPERATING%'' order by a.organization_id');
ADO_Query.Open;
with combobox1do
begin
items.Clear;
ADO_Query.First;
while not ADO_Query.Eofdo
begin
items.Add('广西'+ADO_Query.FieldByName('zzname').Value+'东亚糖业有限公司');
ADO_Query.Next;
end;
end;
ADO_Query.Close;
end;
procedure TRuku.QRLabel5Print(sender: TObject;
var Value: String);
begin
value:=GETDXRMB(yuan);
end;
自己看看吧