UserLand Software Home  |  Manila  |  Radio  |  Support  |  News

DocServer

Prev | Next | String Verbs > string.addCommas

string.addCommas

Syntax string.addCommas (number)

Params number is the numeric value to be formatted with commas.

Action Inserts commas at appropriate points in number.

Returns The reformatted number as a string.

Examples string.addCommas (10249)

   » "10,249"

string.addCommas (999999)

   » "999,999"

n1 = string.addCommas (49527);
n1 = n1 + 3

   » "49,5273"

Note that the + operator acts here a string concatenator since the original value has been converted to a string.

string.addCommas ("98765")

   » "98,765"

Note that the argument is a string enclosed in double quotation marks; Frontier coerces it to a number.

Notes You may supply a string as the number argument provided it can be coerced to a number.

Prev | Next | String Verbs > string.addCommas

Anonymization by Anonymouse.org ~ Adverts
Anonymouse better ad-free, faster and with encryption?
X