function TForm1.Switch(Value: Real): String;
const
ChnUnit: array[0..13] of string = ('分', '角', '元', '拾', '佰', '仟', '万', '拾', '佰', '仟', '亿', '拾', '佰', '仟');
ChnNum : array[0..9] of string = ('零', '壹','贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
var
I: Integer;
StrValue, StrNum: String;
ValueLen: Integer;
begin
if Value <= 0 then
begin
Result := '输入参数应大于零。';
Exit;
end;
StrValue := IntToStr(Round(Value * 100));
ValueLen := Length(StrValue);
Result := '';
for I := 1 to ValueLendo
begin
StrNum := StrValue;
Result := Result + ChnNum[StrToInt(StrNum)] + ChnUnit[ValueLen - I];
end;
if (StrToInt(StrValue[ValueLen])= 0) and (StrToInt(StrValue[ValueLen-1])= 0) then
begin
Result := StringReplace(Result, '零分', '', [rfReplaceAll]);
Result := StringReplace(Result, '零角', '整', [rfReplaceAll]);
end
else
begin
Result := StringReplace(Result, '零分', '', [rfReplaceAll]);
Result := StringReplace(Result, '零角', '', [rfReplaceAll]);
end;
Result := StringReplace(Result, '零元', '元', [rfReplaceAll]);
Result := StringReplace(Result, '零拾', '', [rfReplaceAll]);
Result := StringReplace(Result, '零佰', '', [rfReplaceAll]);
Result := StringReplace(Result, '零仟', '', [rfReplaceAll]);
Result := StringReplace(Result, '零万', '万', [rfReplaceAll]);
end;