Η ρουτίνα που ακολουθεί δημιουργεί το λεκτικό για ποσά σε ευρώ (ολογράφως). Υποστηρίζει και αρνητικά ποσά.
Credits: Κάπου βρήκα έναν αντίστοιχο κώδικα για αγγλικά, μου έδωσε και λίγο σκονισμένο κώδικα ο Γιάννης Κ. σε cobol, σκέφτηκα κι εγώ δυο πραγματάκια, τα συμμάζεψα, τα άπλωσα και να το...
Public Function GetGreekMoneyVerbage(ByVal Amount As Decimal) As String
TryDim PrefixPart As String = String.EmptyDim CentsPart As String = String.EmptyDim CurrencyPart As String = String.EmptyDim SmallPart As String = String.EmptyDim ThousandsPart As String = String.EmptyDim MillionsPart As String = String.EmptyDim BillionsPart As String = String.EmptyDim Cents As IntegerDim Small As IntegerDim Thousands As IntegerDim Millions As IntegerDim Billions As IntegerDim SmallH As IntegerDim ThousandsH As IntegerDim MillionsH As IntegerDim BillionsH As IntegerDim SmallN As IntegerDim ThousandsN As IntegerDim MillionsN As IntegerDim BillionsN As IntegerDim TN(100) As StringDim TF(100) As StringDim HN(10) As StringDim HF(10) As StringHN(0) = ""
HN(1) = "εκατόν"
HN(2) = "διακόσια"
HN(3) = "τριακόσια"
HN(4) = "τετρακόσια"
HN(5) = "πεντακόσια"
HN(6) = "εξακόσια"
HN(7) = "επτακόσια"
HN(8) = "οκτακόσια"
HN(9) = "εννιακόσια"
HF(0) = ""
HF(1) = "εκατόν"
HF(2) = "διακόσιες"
HF(3) = "τριακόσιες"
HF(4) = "τετρακόσιες"
HF(5) = "πεντακόσιες"
HF(6) = "εξακόσιες"
HF(7) = "επτακόσιες"
HF(8) = "οκτακόσιες"
HF(9) = "εννιακόσιες"
TN(0) = ""
TN(1) = "ένα"
TN(2) = "δύο"
TN(3) = "τρία"
TN(4) = "τέσσερα"
TN(5) = "πέντε"
TN(6) = "έξι"
TN(7) = "επτά"
TN(8) = "οκτώ"
TN(9) = "εννέα"
TN(10) = "δέκα"
TN(11) = "έντεκα"
TN(12) = "δώδεκα"
TN(13) = "δεκατρία"
TN(14) = "δεκατέσσερα"
TN(15) = "δεκαπέντε"
TN(16) = "δεκαέξι"
TN(17) = "δεκαεπτά"
TN(18) = "δεκαοκτώ"
TN(19) = "δεκαεννέα"
TN(20) = "είκοσι"
TN(21) = "εικοσιένα"
TN(22) = "εικοσιδύο"
TN(23) = "εικοσιτρία"
TN(24) = "εικοσιτέσσερα"
TN(25) = "εικοσιπέντε"
TN(26) = "εικοσιέξι"
TN(27) = "εικοσιεπτά"
TN(28) = "εικοσιοκτώ"
TN(29) = "εικοσιεννέα"
TN(30) = "τριάντα"
TN(31) = "τριανταένα"
TN(32) = "τριανταδύο"
TN(33) = "τριαντατρία"
TN(34) = "τριαντατέσσερα"
TN(35) = "τριανταπέντε"
TN(36) = "τριανταέξι"
TN(37) = "τριανταεπτά"
TN(38) = "τριανταοκτώ"
TN(39) = "τριανταεννέα"
TN(40) = "σαράντα"
TN(41) = "σαρανταένα"
TN(42) = "σαρανταδύο"
TN(43) = "σαραντατρία"
TN(44) = "σαραντατέσσερα"
TN(45) = "σαρανταπέντε"
TN(46) = "σαρανταέξι"
TN(47) = "σαρανταεπτά"
TN(48) = "σαρανταοκτώ"
TN(49) = "σαρανταεννέα"
TN(50) = "πενήντα"
TN(51) = "πενηνταένα"
TN(52) = "πενηνταδύο"
TN(53) = "πενηντατρία"
TN(54) = "πενηντατέσσερα"
TN(55) = "πενηνταπέντε"
TN(56) = "πενηνταέξι"
TN(57) = "πενηνταεπτά"
TN(58) = "πενηνταοκτώ"
TN(59) = "πενηνταεννέα"
TN(60) = "εξήντα"
TN(61) = "εξηνταένα"
TN(62) = "εξηνταδύο"
TN(63) = "εξηντατρία"
TN(64) = "εξηντατέσσερα"
TN(65) = "εξηνταπέντε"
TN(66) = "εξηνταέξι"
TN(67) = "εξηνταεπτά"
TN(68) = "εξηνταοκτώ"
TN(69) = "εξηνταεννέα"
TN(70) = "εβδομήντα"
TN(71) = "εβδομηνταένα"
TN(72) = "εβδομηνταδύο"
TN(73) = "εβδομηντατρία"
TN(74) = "εβδομηντατέσσερα"
TN(75) = "εβδομηνταπέντε"
TN(76) = "εβδομηνταέξι"
TN(77) = "εβδομηνταεπτά"
TN(78) = "εβδομηνταοκτώ"
TN(79) = "εβδομηνταεννέα"
TN(80) = "ογδόντα"
TN(81) = "ογδονταένα"
TN(82) = "ογδονταδύο"
TN(83) = "ογδοντατρία"
TN(84) = "ογδοντατέσσερα"
TN(85) = "ογδονταπέντε"
TN(86) = "ογδονταέξι"
TN(87) = "ογδονταεπτά"
TN(88) = "ογδονταοκτώ"
TN(89) = "ογδονταεννέα"
TN(90) = "εννενήντα"
TN(91) = "ενεννηνταένα"
TN(92) = "ενεννηνταδύο"
TN(93) = "ενεννηντατρία"
TN(94) = "ενεννηντατέσσερα"
TN(95) = "ενεννηνταπέντε"
TN(96) = "ενεννηνταέξι"
TN(97) = "ενεννηνταεπτά"
TN(98) = "ενεννηνταοκτώ"
TN(99) = "ενεννηνταεννέα"
TF(0) = ""
TF(1) = "μία"
TF(2) = "δύο"
TF(3) = "τρείς"
TF(4) = "τέσσερις"
TF(5) = "πέντε"
TF(6) = "έξι"
TF(7) = "επτά"
TF(8) = "οκτώ"
TF(9) = "εννέα"
TF(10) = "δέκα"
TF(11) = "έντεκα"
TF(12) = "δώδεκα"
TF(13) = "δεκατρείς"
TF(14) = "δεκατέσσερις"
TF(15) = "δεκαπέντε"
TF(16) = "δεκαέξι"
TF(17) = "δεκαεπτά"
TF(18) = "δεκαοκτώ"
TF(19) = "δεκαεννέα"
TF(20) = "είκοσι"
TF(21) = "εικοσιμία"
TF(22) = "εικοσιδύο"
TF(23) = "εικοσιτρείς"
TF(24) = "εικοσιτέσσερις"
TF(25) = "εικοσιπέντε"
TF(26) = "εικοσιέξι"
TF(27) = "εικοσιεπτά"
TF(28) = "εικοσιοκτώ"
TF(29) = "εικοσιεννέα"
TF(30) = "τριάντα"
TF(31) = "τριανταμία"
TF(32) = "τριανταδύο"
TF(33) = "τριαντατρείς"
TF(34) = "τριαντατέσσερις"
TF(35) = "τριανταπέντε"
TF(36) = "τριανταέξι"
TF(37) = "τριανταεπτά"
TF(38) = "τριανταοκτώ"
TF(39) = "τριανταεννέα"
TF(40) = "σαράντα"
TF(41) = "σαρανταμία"
TF(42) = "σαρανταδύο"
TF(43) = "σαραντατρείς"
TF(44) = "σαραντατέσσερις"
TF(45) = "σαρανταπέντε"
TF(46) = "σαρανταέξι"
TF(47) = "σαρανταεπτά"
TF(48) = "σαρανταοκτώ"
TF(49) = "σαρανταεννέα"
TF(50) = "πενήντα"
TF(51) = "πενηνταμία"
TF(52) = "πενηνταδύο"
TF(53) = "πενηντατρείς"
TF(54) = "πενηντατέσσερις"
TF(55) = "πενηνταπέντε"
TF(56) = "πενηνταέξι"
TF(57) = "πενηνταεπτά"
TF(58) = "πενηνταοκτώ"
TF(59) = "πενηνταεννέα"
TF(60) = "εξήντα"
TF(61) = "εξηνταμία"
TF(62) = "εξηνταδύο"
TF(63) = "εξηντατρείς"
TF(64) = "εξηντατέσσερις"
TF(65) = "εξηνταπέντε"
TF(66) = "εξηνταέξι"
TF(67) = "εξηνταεπτά"
TF(68) = "εξηνταοκτώ"
TF(69) = "εξηνταεννέα"
TF(70) = "εβδομήντα"
TF(71) = "εβδομηνταμία"
TF(72) = "εβδομηνταδύο"
TF(73) = "εβδομηντατρείς"
TF(74) = "εβδομηντατέσσερις"
TF(75) = "εβδομηνταπέντε"
TF(76) = "εβδομηνταέξι"
TF(77) = "εβδομηνταεπτά"
TF(78) = "εβδομηνταοκτώ"
TF(79) = "εβδομηνταεννέα"
TF(80) = "ογδόντα"
TF(81) = "ογδονταμία"
TF(82) = "ογδονταδύο"
TF(83) = "ογδοντατρείς"
TF(84) = "ογδοντατέσσερις"
TF(85) = "ογδονταπέντε"
TF(86) = "ογδονταέξι"
TF(87) = "ογδονταεπτά"
TF(88) = "ογδονταοκτώ"
TF(89) = "ογδονταεννέα"
TF(90) = "εννενήντα"
TF(91) = "ενεννηνταμία"
TF(92) = "ενεννηνταδύο"
TF(93) = "ενεννηντατρείς"
TF(94) = "ενεννηντατέσσερις"
TF(95) = "ενεννηνταπέντε"
TF(96) = "ενεννηνταέξι"
TF(97) = "ενεννηνταεπτά"
TF(98) = "ενεννηνταοκτώ"
TF(99) = "ενεννηνταεννέα"
If Amount = 0 Then Return "μηδέν ευρώ"If Amount < 0 ThenAmount = -Amount
PrefixPart = "μείον "
End IfCents = Math.Round(100 * (Amount - Int(Amount)), 0)
If Cents > 0 ThenIf Amount >= 1 ThenIf Cents = 1 ThenCentsPart = "και ένα λεπτό"
ElseCentsPart = "και " & TN(Cents) & " λεπτά"
End IfElseIf Cents = 1 ThenCentsPart = "ένα λεπτό"
ElseCentsPart = TN(Cents) & " λεπτά"
End IfEnd IfEnd IfIf Amount >= 1 ThenCurrencyPart = " ευρώ"
End IfBillions = Int(Amount / (10 ^ 9))
Millions = Int(Int(Amount - Billions * (10 ^ 9)) / (10 ^ 6))
Thousands = Int(Int(Amount - Billions * (10 ^ 9) - Millions * (10 ^ 6)) / (10 ^ 3))
Small = Int(Amount - Billions * (10 ^ 9) - Millions * (10 ^ 6) - Thousands * (10 ^ 3))
BillionsH = Int(Billions / 100)
MillionsH = Int(Millions / 100)
ThousandsH = Int(Thousands / 100)
SmallH = Int(Small / 100)
SmallN = Small - SmallH * 100
ThousandsN = Thousands - ThousandsH * 100
MillionsN = Millions - MillionsH * 100
BillionsN = Billions - BillionsH * 100
If Small = 100 ThenSmallPart = "εκατό"
ElseSmallPart = HN(SmallH) & " " & TN(SmallN)
End IfIf Thousands = 1 ThenThousandsPart = " χίλια"
ElseIf Thousands = 100 ThenThousandsPart = "εκατό χιλιάδες"
ElseIf Thousands > 0 Then ThousandsPart = HF(ThousandsH) & " " & TF(ThousandsN) & " χιλιάδες"End IfEnd IfIf Millions = 1 ThenMillionsPart = "ένα εκατομμύριο"
ElseIf Millions = 100 ThenMillionsPart = "εκατό εκατομύρια"
ElseIf Millions > 0 Then MillionsPart = HN(MillionsH) & " " & TN(MillionsN) & " εκατομμύρια"End IfEnd IfIf Billions = 1 ThenBillionsPart = "ένα δισεκατομμύριο"
ElseIf Billions = 100 ThenBillionsPart = "εκατό δισεκατομμύρια"
ElseIf Billions > 0 Then BillionsPart = HN(BillionsH) & " " & TN(BillionsN) & " δισεκατομμύρια"End IfEnd IfReturn Trim(PrefixPart & BillionsPart & " " & MillionsPart & " " & ThousandsPart & " " & SmallPart & CurrencyPart & " " & CentsPart)CatchReturn Trim(Amount.ToString)End TryEnd Function