-
Notifications
You must be signed in to change notification settings - Fork 0
/
turk_lira.asp
186 lines (142 loc) · 4.46 KB
/
turk_lira.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<% @Language= VBScript %>
<%
' @date : 27/04/2012
' @package : NumberToTurkishLira
' @author : Ferdi Tarakci
' @web : https://www.ferditarakci.com
' @contact : bilgi@ferditarakci.com
Response.Charset = "utf-8"
Response.CodePage = 65001
Function NumberToTurkishLira(ByVal Tutar)
Dim Negatif, Birler, Onlar, Yuzler, Katlar, strTL, Arr, IntBoyut, i
If Not isNumeric(Tutar) Then Exit Function
Negatif = ""
If (Tutar < 0) Then Negatif = "Eksi "
Birler = Array("", "Bir", "İki", "Üç", "Dört", "Beş", "Altı", "Yedi", "Sekiz", "Dokuz")
Onlar = Array("", "On", "Yirmi", "Otuz", "Kırk", "Elli", "Altmış", "Yetmiş", "Seksen", "Doksan")
Yuzler = Array("", "Yüz", "İki Yüz", "Üç Yüz", "Dört Yüz", "Beş Yüz", "Altı Yüz", "Yedi Yüz", "Sekiz Yüz", "Dokuz Yüz")
Katlar = Array("Lira", "Bin", "Milyon", "Milyar", "Trilyon", "Katrilyon")
Tutar = Split(Round(Abs(Tutar), 2), ",")
Arr = Split(FormatNumber(Tutar(0), 0), ".")
IntBoyut = Ubound(Arr)
strTL = ""
For i = 0 To IntBoyut
strTL = strTL & Yuzler(Int(Arr(i) / 100) Mod 10) & " "
strTL = strTL & Onlar(Int(Arr(i) / 10) Mod 10) & " "
If Not (Tutar(0) >= 1000 And Tutar(0) < 2000) Or Arr(i) > 1 Then _
strTL = strTL & Birler(Arr(i) Mod 10) & " "
If (Tutar(0) >= 1000 And Tutar(0) < 2000) Or Not Arr(i) = 0 Then _
strTL = strTL & Katlar(IntBoyut - i) & " "
Next
strTL = Trim(strTL)
If UBound(Tutar) = 1 Then
If Len(Tutar(1)) = 1 Then Tutar(1) = Tutar(1) & "0"
If strTL <> "" Then strTL = strTL & ", "
strTL = strTL & Onlar(int(Tutar(1) / 10) Mod 10) & " "
strTL = strTL & Birler(Tutar(1) Mod 10) & " "
strTL = Negatif & strTL & "Kuruş"
End If
NumberToTurkishLira = Trim(strTL)
End Function
'################################################################
Num = -0.5
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = -13.11
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = -9999999999.99
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 11111111111.11
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 500
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 444444444444.44
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 9.9
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 0.9
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 12.12
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 59421.45
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 1000
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 1985
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 40001.32
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 9000001
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 9458761
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 2147483647.99
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 2250458761.455
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 7343457483664.82
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 650011257345.45
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
Num = 95001125453345.80
Response.Write FormatNumber(Num)
Response.Write "<br>"
Response.Write NumberToTurkishLira(Num)
Response.Write "<br><br>"
%>