function IntToHanguel( Value: Int64 ): String; const NumberChar: array['0'..'9'] of String = ( '¿µ','ÀÏ','ÀÌ','»ï','»ç','¿À','À°','Ä¥','ÆÈ','±¸' ); LevelChar: array[0..3] of String = ( '', '½Ê','¹é','õ' ); DecimalChar: array[0..5] of String = ( '','¸¸','¾ï','Á¶','°æ','Çö' ); var S: String; UseDecimal: Boolean; i, Level: Integer; begin Result := ''; S := IntToStr( Value ); UseDecimal := False; for i := 1 to Length( S ) do begin Level := Length( S ) - i; if S[ i ] <> '0' then begin UseDecimal := True; if Level mod 4 = 0 then begin Result := Result + NumberChar[ S[ i ] ] + DecimalChar[ Level div 4 ]; UseDecimal := False; end else Result := Result + NumberChar[ S[ i ] ] + LevelChar[ Level mod 4 ]; end else if ( Level mod 4 = 0 ) and UseDecimal then begin Result := Result + DecimalChar[ Level div 4 ]; UseDecimal := False; end; end; end; procedure TForm1.Button1Click(Sender: TObject); begin Edit2.Text := IntToHanguel( StrToInt64( Edit1.Text ) ) + '¿ø'; end;
|