Slovom - a Ruby library for verbalizing currency
Last night I released a new ruby gem (slovom).
It converts decimal currency numbers into text in Bulgarian language, which can be useful in financial applications, accounting documents, and all other instances requiring currency verbalization. It handles the specifics of verbally presenting numbers and prices in Bulgarian, including grammatical irregularities, differences due to gender, singularity and plurality and the logic of using or omitting the "and" conjunction from the resulting string.
It's extracted from a pawnbroker/pawnshop rails application which I'm currently working on, called Lombard, to be released as a service in the coming months.
product1.price.to_s => "23.00" product1.price.slovom => "двадесет и три лева" product2.price.to_s => "1563.78" product2.price.slovom => "хиляда петстотин шестдесет и три лева и седемдесет и осем стотинки" product3.price.to_s => "0.75" product3.price.slovom => "седемдесет и пет стотинки" "76.03".to_d.slovom => "седемдесет и шест лева и три стотинки"
It's a bit surprising to see some 50 downloads of the gem in less than a day, hopefully other Bulgarian ruby developers will find it useful.
Here's the github link for convenience.