function convert(money:real):string;
var
smallmode:string;
bigchar,powerchar:string[2];
power,dotpos,i:integer; begin
power:=-2;
smallmode:=formatfloat('0.00',money);
dotpos:=system.pos('.',smallmode);
for i:=length(smallmode) downto 1 do begin
if i=dotpos then continue;
case strtoint(copy(smallmode,i,1))of
1:bigchar:='壹';
2:bigchar:='贰';
3:bigchar:='叁';
4:bigchar:='肆';
5:bigchar:='伍';
6:bigchar:='陆';
7:bigchar:='柒';
8:bigchar:='捌';
9:bigchar:='玖';
0:bigchar:='零';
end;
case power of
-3:powerchar:='厘';
-2:powerchar:='分';
-1:powerchar:='角';
0:powerchar:='元';
1,5,9:powerchar:='拾';
2,6,10:powerchar:='佰';
3,7,11:powerchar:='仟';
4,12:powerchar:='万';
8:powerchar:='亿';
end;
inc(power);
result:=bigchar+powerchar+result;
end;
end;
var
smallmode:string;
bigchar,powerchar:string[2];
power,dotpos,i:integer; begin
power:=-2;
smallmode:=formatfloat('0.00',money);
dotpos:=system.pos('.',smallmode);
for i:=length(smallmode) downto 1 do begin
if i=dotpos then continue;
case strtoint(copy(smallmode,i,1))of
1:bigchar:='壹';
2:bigchar:='贰';
3:bigchar:='叁';
4:bigchar:='肆';
5:bigchar:='伍';
6:bigchar:='陆';
7:bigchar:='柒';
8:bigchar:='捌';
9:bigchar:='玖';
0:bigchar:='零';
end;
case power of
-3:powerchar:='厘';
-2:powerchar:='分';
-1:powerchar:='角';
0:powerchar:='元';
1,5,9:powerchar:='拾';
2,6,10:powerchar:='佰';
3,7,11:powerchar:='仟';
4,12:powerchar:='万';
8:powerchar:='亿';
end;
inc(power);
result:=bigchar+powerchar+result;
end;
end;
解决方案 »
- 把数据库表绑定到DBGrid里面
- 超简单 送分了!!! delphi 怎么创建一个foxpro (.dbf)的临时表???
- 求问如何可以获取服务器ip地址
- fastreport Text Object中字符的问题
- 怎么让TDBComboBox把设置好的纪录全部显示,
- 如何在Delphi中读写Word文档
- 关于StringGrid?
- 具有word表格风格的报表如何做
- 出现错误"error creating coursor handle",请问该怎么解决?
- 谁能告诉我用什么方法把一个Client端由Client传给Server端,然后由Server端保存在本机上!不能用FTP!50分一定给!
- 怎样将倚天码的汉字转换成BIG5码或GB码?或有什么编辑软件可对倚天汉字进行编辑????
- 在DELPHI怎样能及时的记录每次浏览的URL地址
FUNCTION chineseje(Aje:Currency):string;
var
s_1,s_2:widestring;
s_5:char;
s_4:string;
i:integer;
mm:string;
s_6,s_7:widestring;
begin
s_4:=format('%10d',[trunc(aje*100)]);
s_1:='零壹贰叁肆伍陆柒捌玖';
s_2:='仟佰拾万仟佰拾元角分';
i:=1;
mm:='';
WHILE i<=10 do
begin
s_5:=s_4[i];
IF s_5<>' ' then
begin
s_6:=s_1[ord(s_5)-ORD('0')+1];
s_7:=s_2[i];
IF (s_5='0') AND (i<>4) AND (i<>8) then
s_7:='';
IF (copy(s_4,i,2)='00') OR ( (s_5='0') AND (i in [4,8,10])) then
s_6:='';
mm:=mm+s_6+s_7;
IF (s_4[i]='0') AND ((s_4[i+1]<>'0') AND (i in [4,8])) then
mm:=mm+s_1[1];
END;
inc(i);
END ;
IF s_5='0' then
mm:=mm+'整';
result:=mm;
end;