S.A.
Arkadaşlar sanki bir aralar forumda gözüme çarptı ama şimdi bulamadım.
Hemen hemen herkesin kullandığı sayıyı yazıya çevirme fonksiyonunun ingilizcesi lazım ancak ingilizcem yeterli olmadığından yapamadım. Elinde hazır olan veya forumda bulabilen arkadaşlar yardımcı olursa sevinirim.
kolay gelsin..
Sayıyı İngilizce Metne Çevirmek...
Forum kuralları
Forum kurallarını okuyup, uyunuz!
Forum kurallarını okuyup, uyunuz!
Sayıyı İngilizce Metne Çevirmek...
İlimle geçen bir gece,
ibadetle geçen bin geceden hayırlıdır. HZ. MUHAMMED (S.A.)
ibadetle geçen bin geceden hayırlıdır. HZ. MUHAMMED (S.A.)
Kod: Tümünü seç
function Yaziyla_en(Curr: Currency):String;
const
ENGLISH_ONES: array[1..19] of String = (
'one',
'two',
'three',
'four',
'five',
'six',
'seven',
'eight',
'nine',
'ten',
'eleven',
'twelve',
'thirteen',
'fourteen',
'fifteen',
'sixteen',
'seventeen',
'eighteen',
'nineteen');
ENGLISH_TENS: array[1..9] of String = (
'ten',
'twenty',
'thirty',
'forty',
'fifty',
'sixty',
'seventy',
'eighty',
'ninety');
ENGLISH_GROUP_SUFFIXES: array[1..3] of String = (
'thousand',
'million',
'billion');
var
GroupIndex: Integer;
GroupValue: Integer;
Value: Integer;
begin
Value:=Trunc(Curr);
if (Value = 0) then
Result := 'zero'
else
if (Value < 0) then
Result := 'negative ' + Yaziyla_en(-Value)
else
begin
Result := '';
for GroupIndex := (Trunc((8 * SizeOf(Value) - 1) / (3 * Ln(10) / Ln(2)))) downto 0 do
begin
GroupValue := Value div Round(IntPower(10, 3 * GroupIndex)) mod 1000;
if (GroupValue > 0) then
begin
if (GroupValue div 100 > 0) then
Result := Result + ENGLISH_ONES[GroupValue div 100] + ' hundred';
case (GroupValue mod 100) of
0:;
1..19:
Result := Result + ENGLISH_ONES[GroupValue mod 100] + ' ';
else
begin
Result := Result + ENGLISH_TENS[GroupValue div 10 mod 10];
if (GroupValue mod 10 > 0) then
Result := Result + '-' + ENGLISH_ONES[GroupValue mod 10];
Result := Result + ' ';
end;
end;
if (GroupIndex > 0) then
Result := Result + ENGLISH_GROUP_SUFFIXES[GroupIndex] + ' ';
end;
end;
SetLength(Result, Length(Result) - 1); //Remove the trailing space
end;
end;
C. Sunguray
csunguray at netbilisim.kom
Net Bilişim Hizmetleri
Sıradan her programcı bilgisayarın anlayabileceği kodlar yazabilir.
Sadece iyi programcılar insanların da anlayabileceği kodlar yazarlar.
Martin Fowler (http://martinfowler.com/)
csunguray at netbilisim.kom
Net Bilişim Hizmetleri
Sıradan her programcı bilgisayarın anlayabileceği kodlar yazabilir.
Sadece iyi programcılar insanların da anlayabileceği kodlar yazarlar.
Martin Fowler (http://martinfowler.com/)