Commatizing numbers: Difference between revisions

m
minor corrections
(→‎{{header|REXX}}: corrected the "spacing" of pi (period 5).)
m (minor corrections)
Line 22:
Leading zeroes are never commatized.   the string   0000000005714.882   after commatization is:   0000000005,714.882
 
Any period in a number is assummedassumed to be a decimal point.
 
The original string is never changed except by the addition of commas (or whatever is used for insertion), if at all.
Line 28:
Leading signs ('''+''', '''-''') are to be preserved (even superfluous signs).
 
Leading/trailing/imbedded blanks, tabs, and other whitespace are to be preserved.   I.E.g.:   +1024     bottles of beer on the wall.
 
The case (upper/lower) of the exponent indicator is to be preserved.   I.E.g.:   4.8903d-002
 
Any exponent character(s) should be supported:
Line 46:
Numbers may be terminated with any non-digit character, including subscripts and/or superscript. &nbsp; 4142135624² &nbsp; or &nbsp; 7320509076<sub>(24)</sub>.
 
The character(s) to be used for the comma can be specified, and may contain blanks, tabs, and other whitespace characters, as well as multiple characters. &nbsp; The default is the comma (''',''')
character.
 
Line 52:
default period length is 3. &nbsp;
 
I.E.g.: &nbsp; in this example, the period length is five: &nbsp; 56789,12340,14148
 
The location of where to start the scanning for the target field (the numeric part) should be able to be specified. &nbsp; The default is 1 (one).
Line 67:
::::* ===US$0017440 millions=== (in 2000 dollars)
::::* 123.e8000 is pretty big.
::::* The land area of the earth is 57268900(29% of the surface) square miles.
::::* Ain't no numbers in this here words, nohow, no way, Jose.
::::* James was never known as 0000000007
2,295

edits