Arama butonu
Bu konudaki kullanıcılar: 1 misafir
3
Cevap
404
Tıklama
0
Öne Çıkarma
SAYILARIN OKUNUŞU YALNIZ İKİMİLYONÜÇYÜZBİN
S
20 yıl
Yüzbaşı
Konu Sahibi

ARKADAŞLAR DELPHIDE SAYILARIN OKUNUŞUNU NASIL YAZACAĞIM HAZIR BİR FONKSİYON VARMI YOKSA KENDİM Mİ YAPACAĞIM EĞER KENDİM YAPACAKSAM YARDIMCI OLABİLİR MİSİNİZ

ÖRNEK
2.990 YTL

İKİBİNDOKUZYÜZDOKSANYENİTÜRKLİRASI
GİBİ



U
20 yıl
Binbaşı

kendin yapacaksın...
sayıyı string'e çevir. soldan itibaren rakam rakam okumaya başla...
bir çok kontrol yapman gerekiyor, yaparsın onları da...


Bu mesaja 1 cevap geldi.
X
20 yıl
Yüzbaşı

2001 , 1.000.101 gibi durumları kontrol et yane aradaki sıfırlar önemli, oldukça basit bir işlemdir, yaparsın.


Bu mesaja 1 cevap geldi.
D
20 yıl
Yarbay

 
function YTLtoYazi(Value: Double; LiraSimge, KurusSimge: string): string;
const
Birler: array[1..10] of string = ('Bir', 'İki', 'Üç', 'Dört', 'Beş', 'Altı', 'Yedi', 'Sekiz', 'Dokuz', '');
Onlar: array[1..10] of string = ('On', 'Yirmi', 'Otuz', 'Kırk', 'Elli', 'Altmış', 'Yetmiş', 'Seksen', 'Doksan', '');
Diger: array[1..11] of string = ('Trilyon', '', '', 'Milyar', '', '', 'Milyon', '', '', 'Bin', '');
var
Deger: string;
Lira: string;
Kurus: string;
i: integer;
Uclu: string;
LiraYok: Boolean;
procedure UcSayi;
var
s1, s2, s3: byte;
begin
s1 := StrtoInt(Copy(Uclu, 1, 1));
s2 := StrtoInt(Copy(Uclu, 2, 1));
s3 := StrtoInt(Copy(Uclu, 3, 1));
if ((i = 10) and (Uclu = '001')) then
begin
s1 := 10;
s2 := 10;
s3 := 10;
end;
if s1 = 0 then s1 := 10;
if s2 = 0 then s2 := 10;
if s3 = 0 then s3 := 10;
if s1 <> 1 then Result := Result + Birler[S1];
if s1 <> 10 then Result := Result + 'Yüz';
Result := Result + Onlar[S2] + Birler[S3];
end;
begin

if Value < 0 then
begin
Deger := 'Eksi ';
Value := Value * -1;
end;
Lira := InttoStr(Trunc(Int(Value)));
Kurus := InttoStr(Trunc(RoundTo(Frac(Value), -2) * 100));
if Lira = '0' then
LiraYok := True
else
LiraYok := False;
if (Lira = '0') and (Kurus = '0') then
Result := 'Sıfır';

Lira := RightStr(StringofChar('0', 15) + Lira, 15);
Kurus := RightStr('000' + Kurus, 3);
i := -2;
repeat
inc(i, 3);
Uclu := Copy(Lira, i, 3);
UcSayi;
if ((Uclu <> '000') and (i < 13)) then
Result := Result + Diger[i];
until i >= 12;
if not LiraYok then
Result := Result + ' ' + LiraSimge;
if Kurus <> '000' then
begin
Result := Result + ' ';
Uclu := Kurus;
UcSayi;
Result := Result + ' ' + KurusSimge;
end;
Result := Deger + Result;
end;
{$R *.dfm}


[b]//kulllanımı
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption := YTLtoYazi(StrToFloat(Edit1.Text), 'YTL', 'YKR');
end;[/b]




DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.