delphi中如何实现数字大小写转换.不要人民币金额转换的.

来源:百度知道 编辑:UC知道 时间:2024/06/22 06:28:59
如text控件中有一个字符串'2345678.00'如'2=贰'拆分为单一个大写数字.再分别在几个label中显示出来.label1.caption:='贰'...这样显示
请高手指点下.最好有源码.

const
S1='壹';
S2='贰';
S3='叁';
S4='肆';
var
Str: String;
i: integer;
begin
Str:='1234';
edit1.Text:=str;
for i:=1 to length(str) do
case Str[i] of
'1': label1.Caption:=S1;
'2': label2.Caption:=S2;
'3': label3.Caption:=S3;
'4': label4.Caption:=S4;
end;
怎么没悬赏分的。

procedure TForm1.edtxiaoxieKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
edtdaxie.Text := TCase(edtxiaoxie.Text);
end;

function TForm1.PriceUnit(i: integer): string;
begin
case i of
1 : Result := '圆';
2 : Result := '拾';
3 : Result := '佰';
4 : Result := '仟';
5 : Result := '万';
6,7,8 : Result := PriceUnit(i - 4);
9 : Result := '亿'