Jump to content

Commatizing numbers: Difference between revisions

m
→‎{{header|REXX}}: added/changed comments and whitespace, changed indentations, added a comment to the REXX section header.
m (italicized the made-up word.)
m (→‎{{header|REXX}}: added/changed comments and whitespace, changed indentations, added a comment to the REXX section header.)
Line 342:
 
=={{header|REXX}}==
The hardest part of the   '''comma'''   function is to locate where a useable number starts and ends.
<lang rexx>/*REXX program add commas (or other chars) to a number within a string.*/
@. =
Line 395 ⟶ 396:
'''output''' when using the internal strings for input:
<pre>
before:pibefore──►pi=3.14159265358979323846264338327950288419716939937510582097494459231
after:piafter──►pi=3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 58209 74944 59231
 
before:Thebefore──►The author has two Z$100000000000000 Zimbabwe notes (100 trilliontrillian).
after:Theafter──►The author has two Z$100.000.000.000.000 Zimbabwe notes (100 trilliontrillian).
 
before:before──►-in Aus$+1411.8millions
after:after──►-in Aus$+1,411.8millions
 
before:before──►===US$0017440 millions=== (in 2000 dollars)
after:after──►===US$0017,440 millions=== (in 2000 dollars)
 
before:123before──►123.e8000 is pretty big.
after:123after──►123.e8000 is pretty big.
 
before:Thebefore──►The land area of the earth is 57268900(29% of the surface) square miles.
after:Theafter──►The land area of the earth is 57,268,900(29% of the surface) square miles.
 
before:Ainbefore──►Ain't no numbers in this here words, nohow, no way, Jose.
after:Ainafter──►Ain't no numbers in this here words, nohow, no way, Jose.
 
before:Jamesbefore──►James was never known as 0000000007
after:Jamesafter──►James was never known as 0000000007
 
before:Arthurbefore──►Arthur Eddington wrote: I believe there are 15747724136275002577605653961181555468044717914527116709366231425076185631031296 protons in the universe.
after:Arthurafter──►Arthur Eddington wrote: I believe there are 15,747,724,136,275,002,577,605,653,961,181,555,468,044,717,914,527,116,709,366,231,425,076,185,631,031,296 protons in the universe.
 
before:before──► $-140000±100 millions.
after:after──► $-140,000±100 millions.
 
before:6before──►6/9/1946 was a good year for some.
after:6after──►6/9/1946 was a good year for some.
</pre>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.