Arsip: menambah kata rupiah dibelakang terbilang

 
user image
more 11 years ago

ricky_seldjatem

saya sudah sempat download program terbilang dari om sony, dan saya modifikasi sedikit, jd ketika nominalnya dimasukan didlm edit box 1, maka secara otomatis edit box 2 nya terisi terbilang dgn fungsi editchange, cuma yang jd masalah bagaimana caranya supaya dibelakang terbilang ada tulisan rupiah. contoh : edit1 = 1500, edit2nya=seribu lima ratus rupiah, berikut contoh source codenya : function Terbilang(x:integer):string; const abil : array of string[10]=('','satu','dua','tiga', 'empat','lima','enam','tujuh','delapan','sembilan', 'sepuluh','sebelas'); begin if (x<12) then Result:=' '+abil[x] else if (x<20) then Result:=Terbilang(x-10)+' belas' else if (x<100) then Result:=Terbilang(x div 10)+' puluh'+Terbilang(x mod 10) else if (x<200) then Result:=' seratus'+ Terbilang(x-100) else if (x<1000) then Result:=Terbilang(x div 100)+' ratus'+Terbilang(x mod 100) else if (x<2000) then Result:=' seribu'+ Terbilang(x-1000) else if (x<1000000) then Result:=Terbilang(x div 1000)+' ribu'+Terbilang(x mod 1000) else if (x<1000000000) then Result:=Terbilang(x div 1000000)+' juta'+Terbilang(x mod 1000000); end; procedure TForm1.Edit1Change(Sender: TObject); begin edit2.Text:=(terbilang(strtoint(edit1.Text))); end;
user image
more 11 years ago

betamax

tinggal ditambahin aja lagi dengan string 'Rupiah'

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + 'Rupiah');
met mencoba.
user image
more 11 years ago

mas_kofa

@betamax: tinggal ditambahin aja lagi dengan string 'Rupiah'

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + 'Rupiah');
met mencoba.
kurang sepasi

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + ' Rupiah');
xixixiiii..............:D
user image
more 11 years ago

ImanD

@mas_kofa: [quote:8798c8885e="betamax"]tinggal ditambahin aja lagi dengan string 'Rupiah'

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + 'Rupiah');
met mencoba.[/quote:8798c8885e] kurang sepasi

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + ' Rupiah');
xixixiiii..............:D
wakakakkak R pada Rupiah kudu kecil biar sepadan dengan yg diinginkan

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + ' rupiah');
user image
more 11 years ago

reminder2k1

@ImanD: [quote:7e74f23f98="mas_kofa"][quote:7e74f23f98="betamax"]tinggal ditambahin aja lagi dengan string 'Rupiah'

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + 'Rupiah');
met mencoba.[/quote:7e74f23f98] kurang sepasi

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + ' Rupiah');
xixixiiii..............:D[/quote:7e74f23f98] wakakakkak R pada Rupiah kudu kecil biar sepadan dengan yg diinginkan

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + ' rupiah');
wakakakakakak... Nyari apalagi yang kurang ya??? Kayaknya dah di embat semua ma bro @ImanD... xixixixixixixi :mrgreen:
user image
more 11 years ago

nizar

Asyiiik.... Ini saya lengkapi Terbilang versi VBA Ms. Excel Function Terbilang(x As Currency) As String Dim r As Currency, sisa As Currency abil = Array("", "satu", "dua", "tiga", "empat", "lima", "enam", "tujuh", "delapan", "sembilan", "sepuluh", "sebelas") If (x < 12) Then Result = " " + abil(x) ElseIf (x < 20) Then Result = Terbilang(x - 10) + " belas" ElseIf (x < 100) Then Result = Terbilang(x \ 10) + " puluh" + Terbilang(x Mod 10) ElseIf (x < 200) Then Result = " seratus" + Terbilang(x - 100) ElseIf (x < 1000) Then Result = Terbilang(x \ 100) + " ratus" + Terbilang(x Mod 100) ElseIf (x < 2000) Then Result = " seribu" + Terbilang(x - 1000) ElseIf (x < 1000000) Then Result = Terbilang(x \ 1000) + " ribu" + Terbilang(x Mod 1000) ElseIf (x < 1000000000) Then Result = Terbilang(x \ 1000000) + " juta" + Terbilang(x Mod 1000000) ElseIf (x < 1000000000000#) Then r = Fix(x / 1000000000#) sisa = x - r 1000000000# Result = Terbilang(r) + " milyar" + Terbilang(sisa) ElseIf (x < 1E+15) Then r = Fix(x / 1000000000000#) sisa = x - r 1000000000000# Result = Terbilang(r) + " trilyun" + Terbilang(sisa) End If Terbilang = Result End Function cocok gak?
user image
more 11 years ago

betamax

wekeke. sekarat kabeh... slash me ndeso mode ON
user image
more 11 years ago

alvonz

unit Terbilang; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; type Tterbilang = class(TComponent) private NullValS : string; FAuthor : string; FNumber : integer; procedure SetNumber(value:integer); function GetTerbilang:string; protected { Protected declarations } public constructor Create(AOwner:TComponent); override; destructor Destroy; override; published property Author : string read FAuthor write NullValS; property Number : integer read FNumber write SetNumber; property Terbilang : string read GetTerbilang write NullValS; end; procedure Register; implementation const Satu = 'satu '; Belas = 'belas '; Angka : arrayof string = ('se','dua ','tiga ','empat ', 'lima ','enam ','tujuh ','delapan ', 'sembilan '); Satuan3 : arrayof string = ('ratus ','puluh '); Satuan : arrayof string = ('','ribu ','juta ','milyar '); function Tterbilang.GetTerbilang:string; var tmp,tmp2 : string; TStr : TStringList; i,j : integer; begin TStr:=TStringList.Create; tmp :=format('%0.0n',[strtofloat(inttostr(FNumber))])+ThousandSeparator; while tmp <> '' do begin TStr.Insert(0,copy(tmp,1,pos(ThousandSeparator,tmp)-1)); delete(tmp,1,pos(ThousandSeparator,tmp)); end; for i:=0 to TStr.Count-1 do TStr.Strings[i] :=format('%0.3d',)]); for i:=TStr.Count-1 downto 0 do begin tmp :=TStr.Strings[i]; for j:=1 to 3 do begin if tmp[j] = '0' then continue; case j of 1 : if tmp[j] <> '0' then tmp2 := tmp2 + Angka[strtoint(tmp[j])] + Satuan3[j]; 2 : case tmp[j] of '1' : begin case tmp[j+1] of '0' : tmp2 := tmp2 + Angka[strtoint(tmp[j])] + Satuan3[j]; '1'..'9' : tmp2 := tmp2 + Angka[strtoint(tmp[j+1])] + Belas; end; break; end; '2'..'9' : tmp2 := tmp2 + Angka[strtoint(tmp[j])] + Satuan3[j]; end; 3 : case tmp[j] of '1' : case FNumber of 1 : tmp2 := tmp2 + Satu; 1000..1999: if i = 0 then tmp2 := tmp2 + Satu else tmp2 := tmp2 + Angka[strtoint(tmp[j])]; else tmp2 :=tmp2 + Satu; end; else tmp2 := tmp2 + Angka[strtoint(tmp[j])]; end; end; end; if strtoint(tmp) <> 0 then tmp2 := tmp2 + Satuan[i]; end; TStr.Free; result :=Trim(tmp2); end; procedure Tterbilang.SetNumber(value:integer); begin if value <> FNumber then FNumber :=value; end; constructor Tterbilang.Create(AOwner:TComponent); begin inherited Create(AOwner); FAuthor :='Terbilang Component 2008'; FNumber :=0; end; destructor Tterbilang.Destroy; begin inherited; end; procedure Register; begin RegisterComponents('TerbilangComponent', [Tterbilang]); end; end. kali aja bermanfaat nih
user image
more 11 years ago

kheava

makyushhhhhhhhhhhh
user image
more 11 years ago

ichan29

@ImanD: [quote:f2fda0c64b="mas_kofa"][quote:f2fda0c64b="betamax"]tinggal ditambahin aja lagi dengan string 'Rupiah'

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + 'Rupiah');
met mencoba.[/quote:f2fda0c64b] kurang sepasi

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + ' Rupiah');
xixixiiii..............:D[/quote:f2fda0c64b] wakakakkak R pada Rupiah kudu kecil biar sepadan dengan yg diinginkan

edit2.text := ((Terbilang(Strtoint(Edit1.text))) + ' rupiah');
biar tdk terlalu makan tempat "+" jgn ada spasi
more ...
  • Pages:
  • 1
  • 2
Share to

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com