Return text value of a number
Is there a formula on numbers that would return the text value of a number
Example: 100 = One Hundred
MacBook Pro (Retina, 13-inch, Mid 2014), OS X Mavericks (10.9.5)
Apple Event: May 7th at 7 am PT
Is there a formula on numbers that would return the text value of a number
Example: 100 = One Hundred
MacBook Pro (Retina, 13-inch, Mid 2014), OS X Mavericks (10.9.5)
Hi sud,
I think you will have to use VLOOKUP() and create a lookup table that returns your text.
quinn
Hi SG,
I remember a thread more recently where Wayne was doing somethng similar. He may have been translating the other way. Since I am not on iCloud Drive I cold not see Badunit's solution.
quinn
Hi quinn,
I remember a more recent thread too, but can't find it...
SG
We will just have to shine our Bat light into the skies of Gotham and hope that Wayne is paying attention.
I think it was this thread that I remember. Wayneposts a link to a Dropbox file (down deep in the thread).
SG
Hi SG,
Good find. That is the one.
quinn
i
I wrote a program for uses on the command line so you can type a list of numbers and it provides a list of words for the numbers:
you can download the application here:
https://www.dropbox.com/s/ambw65mtbsbc6jb/NumWrite.zip?dl=0
To use, download the zip file, then unzip (by double clicking) the file.
This will create a file named "NumWrite"
(NOTE: I just tried my own instructions and realized there is a good chance you will download to the folder "Downloads". If you do this there is also a good chance there are many files in the folder. Create a new folder called NumberWriter, or what ever, and move the zip file into this folder before proceeding)
Open the terminal (in the folder "/Applications/Utilities").
If you are not familiar with the terminal that is ok. The process will seem hard but it is not too bad.
Make sure the window where you unzipped the file is visible and you can see the file you unzipped (the executable... the program).
Once the terminal is launched you should see a command prompt. On my computer is looks like this:
now change directories in the terminal so the terminal window is using the same folder where you unzipped the executable.
Type "cd " (that is "c" then "d" then space)
now drag the folder from the title bar of the window onto the terminal:
this wil "drop" the path to the folder where the program is in the terminal. Now hit the return key. now to make sure this work let's get a listing of whats in the folder.
Type: "ls -al" then return
you should see something like:
drwxr-xr-x+ 4 wayne staff 136 Oct 14 21:37 .
drwxr-xr-x@ 4 wayne staff 136 Oct 14 20:26 ..
-rw-r--r--@ 1 wayne staff 6148 Oct 14 21:42 .DS_Store
-rwxr-xr-x+ 1 wayne staff 13996 Oct 14 21:36 NumWrite
Notice the "NumWrite" is listed.
Now try the program. Type:
"./NumWrite 200" then hit the enter key
The "./" means start in the current directory"
you should get:
Proton:Debug wayne$ ./NumWrite 200
200 Two Hundred
Now try:
"./NumWrite 200 2000 20000"
you should get:
Proton:Debug wayne$ ./NumWrite 200 2000 20000
200 Two Hundred
2000 Two Thousand
20000 Twenty Thousand
the list can be as many as 128 (maybe more) numbers separated by spaces.
typing this:
"./NumWrite 3026832517 962356513 13722 866195335984 8 690963576 5501237 8068 619929785 327"
will produce the result:
Proton:Debug wayne$ ./NumWrite 3026832517 962356513 13722 866195335984 8 690963576 5501237 8068 619929785 327
3026832517 Three Billion Twenty Six Million Eight Hundred Thirty Two Thousand Five Hundred Seventeen
962356513 Nine Hundred Sixty Two Million Three Hundred Fifty Six Thousand Five Hundred Thirteen
13722 Thirteen Thousand Seven Hundred Twenty Two
866195335984 Eight Hundred Sixty Six Billion One Hundred Ninety Five Million Three Hundred Thirty Five Thousand Nine Hundred Eighty Four
8 Eight
690963576 Six Hundred Ninety Million Nine Hundred Sixty Three Thousand Five Hundred Seventy Six
5501237 Five Million Five Hundred One Thousand Two Hundred Thirty Seven
8068 Eight Thousand Sixty Eight
619929785 Six Hundred Nineteen Million Nine Hundred Twenty Nine Thousand Seven Hundred Eighty Five
327 Three Hundred Twenty Seven
I hope this helps. You can copy the result from the terminal by selecting the text, the copy, the switch to the target application and paste.
This could also be done as an Applescript if SGIII wants to help. If so I can send the c source as a starting point.
Hello sudz10:
I have uploaded a template that will convert a number from 1 to 999999 into words, to the web site:
http://www.iworkcommunity.com/
Once the moderator reviews it, it will be ready to download as a template zip file. Search for
"number to word conversion" to find it. At least for a while, as a new entry, it should be the first listed.
by mswint
Hi sudz 10,
If you are familiar with AppleScript, you can use AppleScriptObjective-C to convert numbers to texts. I am reading the Everyday AppleScriptObjC written by Shane Stanley and found the script to do that with the NSNumberFormatter in Chapter 20 "Pretty Numbers". It's powerful and fast.
Here is a version that uses an Applescript with the c program:
https://www.dropbox.com/s/ajlqxwqbaew5e4m/NumWriterWithScript.zip?dl=0
unzip the file then open the filer and double click the script
Thank you all for your replies. The primary purpose of my request was to enable me to print bulk cheques and invoices using numbers (apple). I used to do this on excel on my PC.
Although it not easy as excel, I will use your suggestions to simplify my task on numbers.
Thank you!!
I bet that SGIII can turn my simple script into one that processes a whole column of data in a convenient way.
turn my simple script into one that processes a whole column of data in a convenient way.
Here's one (below).
It ignores decimals.
SG
try
-- get the values from selected Numbers cells
tell application "Numbers"
set t to front document's active sheet's first table whose selection range's class is range
set vv to "" -- will contain space-separated string of values retrieved from selected cells
repeat with c in t's selection range's cells
set vv to vv & my convertNum(c's value) & " "
end repeat
end tell
-- feed the values retrieved from Numbers to NumWrite, first converting any AS scientific notation
tell application "Finder" to set scpt to ((path to me)'s container as alias)'s POSIX path & "NumWrite"
set r to do shell script scpt's quoted form & " " & vv
-- (NumWrite returns a 2-column tab-separated string: numeral in col 1, words equivalent in col 2)
-- extract NumWrite's col 2 for pasting into Numbers
set str to "" -- will contain return-separated numbers expressed as words
set AppleScript'stext item delimiters to " "
repeat with p from 2 to countr'sparagraphs-- "from 2" skips NumWrite's leading blank line
set str to str & r'sparagraphp'swords 2 thru -1 & return-- skips word 1=the number in col 1
end repeat
set AppleScript'stext item delimiters to ""
set the clipboard tostr
display notification "Click once in a cell and command-v to paste numbers expressed as words."
on error
display alert "Select cells containing numbers,"
end try
to convertNum(aNum) -- converts from AS's scientific notation when necessary
do shell script "printf \"%.0f\" " & aNum
end convertNum
Return text value of a number