It happens (not very often to be honest, but it happens) that, generating documents using a program, you need to put a number/price into words.
Let’s be clear: in many contexts, having to provide a price, you can simply express it in numbers (e.g. 1,992 € ). However, there are special situations (especially here in Italy, where we really do love bureaucracy!) in which the possibility that numbers could be incorrectly written (by a computer?) requires to replicate the value into words too: one thousand nine hundred and ninety-two / 00. Funny, isn’t it?
I do not find necessary to recall that the complexity of this operation is directly proportional to the tricks that language hides inside itself.
Here we propose a solution in two languages: English, which revealed to be structured and pragmatic; and Italian, which led to some more complexities.
The Code: NumericToWords