Anonymous user
Number names/REXX: Difference between revisions
m
alligned some text.
m (added comments in the section header concerning what the REXX program supports. -- ~~~~) |
m (alligned some text.) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1:
The full source of the '''$SPELL#''' REXX program is included here ──► [[$SPELL.REX|$SPELL#.REX]].
<br>The full help for the '''$SPELL#''' REXX program is included here ──► [[$SPELL.HEL|$SPELL#.HEL]].
<br>I had first considered taking the original program and ripping out all the good stuff and just solve the ▼
▲
<br>Not included is the '''$H''' program which shows (among other things) the help (documentation).▼
▲
This REXX program supports:
* long and short scale (American and British styles)
* ''ordinal numbers'' and ''cardinal numbers''
* expressing the number as a
* decimal points (<big>'''6'''</big> is different than <big>'''6.'''</big>)
* decimal fractions
* numbers with leading zeroes (as well as trailing zeroes)
* leading signs (<big>'''+'''</big> or <big>'''-'''</big>)
* exponential notation
* currency symbols
* adding commas (or whatever) to the output (including blanks)
* numbers (American) roughly up to 3,000 digits
* numbers (English) roughly up to 6,000 digits
* numbers with metric suffixes, namely:
** '''K M G T P E Z Y X W V U'''
Line 34 ⟶ 36:
** or any suitable abbreviation of the above
* numbers expressed as a factorial (such as '''100!''').
* user-
** signs ('''-6''' ''could be'' expressed as '''negatory six''')
** decimal point ('''2.4''' ''could be'' expressed as '''two
** power (the power of ten that the number is being raised to)
** currency symbols
Line 42 ⟶ 44:
** blanks
** a value of zero
* numbers may have commas but they aren't
The program has a pretty hefty prologue which determines (among other things):
Line 48 ⟶ 50:
* the operating system (and maybe the type)
* the name of the REXX program: it's filename, filetype, filemode (or path, if you will)
* the access-name used to acquire environmental variables' values
* if '''EBCDIC''' or '''ASCII''' system
* which REXX (or KEXX) is being used
* the name of the program (command) used to clear the terminal screen
* if appropriate, invokes
I'm still working on the REXX program to reduce the amount of names by programmatically generating any amount of number-names (instead of having a fixed amount of names in text form).
Also note that there appears not to be a consensus on the names of some numbers:
Line 63 ⟶ 65:
* '''tre*''' also named '''tres*'''
<br>The '''$SPELL#''' REXX program makes use of '''$T''' REXX program which is used to display text and/or write the text to a file.
<br>The '''$T''' REXX program is included here ──► [[$T.REX]].
<br>The help for the '''$T''' REXX program is included here ──► [[$T.HEL]].
<br><br>The '''$SPELL#''' REXX program makes use of '''$ERR''' REXX program which is used to display error messages (via '''$T''').
<br>The '''$ERR''' REXX program is included here ──► [[$ERR.REX]].
<br>The help for the '''$ERR''' REXX program is included here ──► [[$ERR.HEL]].
<br><br>Some older REXXes don't have a '''changestr'''
<br><br>
==output==
Output when using the input of: <tt> 373 ordinal </tt>
three hundred seventy-third
Output when using the input of: <tt> 373 </tt>
three hundred seventy-three
Output when using the input of: <tt> +45 </tt>
plus forty-five
Output when using the input of: <tt> 1989 asYear </tt>
nineteen eighty-nine
Output when using the input of: <tt> -12.79 </tt>
minus twelve point seven nine
Output when using the input of: <tt> $119.63 </tt>
one hundred nineteen dollars and sixty-three cents
Output when using the input of: <tt> 3456T </tt>
three quadrillion four hundred fifty-six trillion
Output when using the input of: <tt> 4Ki </tt>
four thousand ninety-six
Output when using the input of: <tt> 6! </tt>
seven hundred twenty
Output when using the input of: <tt> 10dozen </tt>
one hundred twenty
Output when using the input of: <tt> 70000000000000... </tt> (3,000 zeroes total)
seven octononagintanongentillion
|