答案:{先在窗口上放一个TEdit; 然后再放一个TDateTimePicker
,最后放一个Tbutton
确保这个函数在下一个过程前面,不然系统会报错}
function NumToCStr(Num: Integer): String;
begin
ReSult := '';
case Num of
0: ReSult := '零';
1: ReSult := '壹';
2: ReSult := '贰';
3: ReSult := '叁';
4: ReSult := '肆';
5: ReSult := '伍';
6: ReSult := '陆';
7: ReSult := '柒';
8: ReSult := '捌';
9: ReSult := '玖';
10: ReSult := '拾';
11: ReSult := '拾壹';
12: ReSult := '拾贰';
13: ReSult := '拾叁';
14: ReSult := '拾肆';
15: ReSult := '拾伍';
16: ReSult := '拾陆';
17: ReSult := '拾柒';
18: ReSult := '拾捌';
19: ReSult := '拾玖';
20: ReSult := '贰拾';
21: ReSult := '贰拾壹';
22: ReSult := '贰拾贰';
23: ReSult := '贰拾叁';
24: ReSult := '贰拾肆';
25: ReSult := '贰拾伍';
26: ReSult := '贰拾陆';
27: ReSult := '贰拾柒';
28: ReSult := '贰拾捌';
29: ReSult := '贰拾玖';
30: ReSult := '叁拾';
31: ReSult := '叁拾壹';
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
SYear,SMonth,SDay,tmpYear: String; i: Integer;
begin
SYear := FormatDateTime('YYYY',DateTimePicker1.Date);
SMonth := FormatDateTime('MM',DateTimePicker1.Date);
SDay := FormatDateTime('DD',DateTimePicker1.Date);
tmpYear := '';
for i := 0 to Length(SYear) do begin
if SYear[i] in ['0','1','2','3','4','5','6','7','8','9'] then
tmpYear := tmpYear + NumToCStr(StrToInt(SYear[i]));
end;
Edit1.Text := tmpYear + '年' + NumToCStr(StrToInt(SMonth)) +
'月' + NumToCStr(StrToInt(SDay)) + '日';
end;
其他:QLabel的font属性里设置呀 function tfrmlist.convert(money:real):string;
var
small:string;
bigchar,powerchar:string[2];//汉字占用两个字节
power,dotpos,i:integer;
begin
power:=-2; //字符权值,小数点后面为负数
//将浮点数转换为字符串,小数点后面保留两位
small:=formatfloat('0.00',money);
//取得小数点的位置
dotpos:=pos('.',small);
//从右向左转换
for i:=length(small) downto 1 do
begin
if i=dotpos then continue;//小数点则不用转换
//将字符转换为整数 0-9
case strtoint(copy(small,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;
再做一个BUTTON,然后用以下代码
frmprintlist.QRLabel9.Caption :=convert(strtofloat( edit2.Text ) );//将钱转变大写
还有些小问题,自己慢慢研究吧。
上一个:delphi7配置问题
下一个:delphi中根据record记录集中一个排序后的记录值输出所有记录值可以用什么方法