Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια

rousso's .net blog

the .net blog of Yannis Roussochatzakis
GreekEuroVerbalizer

Reading a recent post in dotNetZone.gr I decided to implement as a proof-of-concept an algorithm using regular expressions to convert a decimal numeral representing an amount of money, to a verbal from in Greek text.

So to make it more obvious the problem was to convert 1,234,567.89 Euros to the string "One Million, Two Hundred Thirty Four, Five Hundred Sixtyseven Euros and Eightynine Cents" (only that the text should be in Greek and not English as I typed here to make the concept clear for everyone).

The algorithm I came up with is not the best that I could do but is enough as a proof of concept. Do not be alarmed if it seems too long at first glance. It's just the code comments that make it so long.

So to find the algorithm:

 

Share
Posted: Τρίτη, 23 Αυγούστου 2005 3:24 μμ από το μέλος rousso
Δημοσίευση στην κατηγορία:

Σχόλια:

Χωρίς Σχόλια

Έχει απενεργοποιηθεί η προσθήκη σχολίων από ανώνυμα μέλη