Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function szazas(szam:integer):string;
- var
- tmp: string;
- begin
- if szam>999 then
- begin
- Result:='#';
- exit;
- end;
- tmp:='';
- case Length(IntToStr(szam)) of
- 1: Result:=Egyesek[szam];
- 2: begin
- if (((szam div 10)=1) or ((szam div 10)=2)) and (szam-((szam div 10)*10)<>0) then tmp:=Extra[szam div 10]
- else tmp:=Tizesek[szam div 10];
- Result:=tmp+Egyesek[szam-((szam div 10)*10)];
- end;
- 3: begin
- tmp:=Egyesek[szam div 100]+'száz';
- if (((szam-((szam div 100)*100)) div 10) in [1,2]) and (((szam-((szam div 100)*100)) mod 10)>0) then tmp:=tmp+Extra[((szam-((szam div 100)*100)) div 10)]
- else tmp:=tmp+Tizesek[((szam-((szam div 100)*100)) div 10)];
- Result:=tmp+Egyesek[((szam-((szam div 100)*100)) mod 10)];
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement