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