|
1,020,045원을 일백이만사십오원이라고 표시 되는 델파이 쏘스입니다
빌더에서는 이런 쏘스를 못찾아서 델파이것을 가져 왔는데 빌더로 고치기가 싶지가 않쿤여
고쳐서 같이 쓰면 좋을듯한데여 ^^
여기서 부터~~~
function Amount(N: Longint): String;
const
Units: array[0..9] of String = ('', '일', '이', '삼', '사', '오',
'육', '칠', '팔', '구');
Lower: array[0..3] of String = ('', '십','백','천');
Higher: array[0..4] of String = ('', '만','억','조','경');
HighLevel: Integer = 0;
begin
case N of
0..9: Result := Result + Units[N];
10..99:
Result := Result +
Amount(N div 10) + Lower[1] + Amount(N mod 10);
100..999:
Result := Result +
Amount(N div 100) + Lower[2] + Amount(N mod 100);
1000..9999:
Result := Result +
Amount(N div 1000) + Lower[3] + Amount(N mod 1000);
else
begin
inc(HighLevel);
Result := Result +
Amount(N div 10000) + Higher[HighLevel] + Amount(N mod 10000);
dec(HighLevel);
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
try
Label1.caption := Amount(Trunc(StrToFloat(Edit1.Text)));
except
on EConvertError do
Label1.caption := '정확한 숫자를 입력하세요';
end;
end;
end
~~~~ 요까정 입니다..ㅜ.ㅜ
델파이와 C++빌더를 아시는 고수님 꼭 부탁좀 드립니다..
참..위 쏘스중에 C++ 빌더론 지원 안되는것도 있나요..??
참고로 전 C++빌더 3.0 입니다..
|