convert decimal numbers to letters

enrique_aeo
enrique_aeo used Ask the Experts™
on
Hi experts, I need to do a function in the database to convert decimal numbers to letters, for example:
1.11
12.78
the integers can range from 1 to 20
the decimal part can range from 1-99
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010

Commented:
Hello enrique_aeo,

Please explain what you mean by "convert decimal numbers to letters".

Do you perhaps mean "twelve and seventy-eight one-hundredths", or do you mean something else?

Regards,

Patrick
Top Expert 2012

Commented:
Or "doce con setenta y ocho"

:)

Author

Commented:
ok, would be something like
12.40 = doce y cuarenta centesimas
15.30 = quince y treinta centesimas
7.30   = siete y treinta centesimas
15.46 = quince y cuarenta y seis centésimas
11.4 = 11.40 = once y cuarenta decimas

the integer part can range from 1-20.
The decimal portion can range from 1-49
Top Expert 2012
Commented:
It would take me all of 2 hours to figure it out and I am sure it would not be perfect.  So instead do a Google search for "Spell Number" function in Spanish.  I am sure there has to be at least dozen for T-SQL alone.
Top Expert 2012

Commented:
P.S.  Make sure you get one for "Real Academia" Spanish and not Latin American Spanish.

:)

Author

Commented:
ok, I will apply the exact specifications, because I'm not sure and will again ask the question
Top Expert 2012

Commented:
Here is one example of converting a number to Spanish:
http://www.portalfox.com/index.php?name=News&file=article&sid=417&mode=nested&order=0&thold=0

It does not fully meets your requirements as it uses the US style for cents as in "CON 78/100" as opposed to your need for "y 78 centésimas" and uses all caps, but it should not be too difficult to modify.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial