Convert Numbers to letters

5 views (last 30 days)
Xavier Marmol
Xavier Marmol on 31 Aug 2015
Edited: Stephen23 on 10 Aug 2016
Hi, excuse me, i hope you can help me with this, i want to convert numbers to letters in matlab, for example: insert number: 21 Answer: twenty one like that , i don't know how to do, what function i have to use?

Answers (1)

Stephen23
Stephen23 on 31 Aug 2015
Edited: Stephen23 on 10 Aug 2016
There is no inbuilt MATLAB function that converts numeric values to words, but you can use my FEX submission num2words to do exactly this:
It has been extensively tested, and has lots of useful options too.
Here are some examples:
num2words(0)
ans = 'zero'
num2words(-1024)
ans = 'negative one thousand and twenty-four'
num2words(pi, 'order',-10)
ans = 'three point one four one five nine two six five three six'
num2words(intmax('uint64'), 'sigfig',3, 'type','highest')
ans = 'eighteen point four quintillion'

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!