Jump to content

Commatizing numbers: Difference between revisions

m
added whitespace, appended a closing quote character.
m (used a superscript 2 instead of a "squared" glyph.)
m (added whitespace, appended a closing quote character.)
Line 23:
Leading zeroes are never commatized.   The string   0000000005714.882   after commatization is:   0000000005,714.882
 
Any &nbsp; ''period'' &nbsp; (<big><b>.</b></big>) &nbsp; in a number is assumed to be a &nbsp; ''decimal point''.
 
The original string is never changed &nbsp; ''except'' &nbsp; by the addition of commas &nbsp; [or whatever character(s) is/are used for insertion], if at all.
Line 46:
::::::* &nbsp; 10000pow(pi)
 
<br>Numbers may be terminated with any non-digit character, including subscripts and/or superscript: &nbsp; 4142135624<sup>23</sup> &nbsp; or &nbsp; 7320509076<sub>(base 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 (<big>''','''</big>) character.
 
The &nbsp; ''period length'' &nbsp; can be specified &nbsp; (sometimes referred to as "thousands" or "thousands separators"). &nbsp; The &nbsp; ''period length'' &nbsp; can be defined as the length (or number) of the decimal digits between commas. &nbsp; The default period length is &nbsp; <big>3</big>.
 
::: E.G.: &nbsp; in this example, the &nbsp; ''period length'' &nbsp; is five: &nbsp; 56789,12340,14148
Line 60:
 
;Strings to be used as a minimum:
The value of &nbsp; pi &nbsp; should be separated with blanks every &nbsp; '''5''' &nbsp; places past the decimal point,
<br>the Zimbabwe dollar amount should use a decimal point for the "comma" separator:
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.