Garry's Mod Wiki

Garry's Mod Wiki

  string string.Comma( number value, string separator = "," )

Description

Inserts commas for every third digit of a given number.

Arguments

1 number value
The input number to commafy
2 string separator = ","
An optional string that will be used instead of the default comma.

Returns

1 string
The commafied string

Example

Demonstrates the use of string.Comma

print( string.Comma( 123456789 ) )
Output:
123,456,789

Example

Demonstrates the use of the 2nd argument (separator)

print( "$" .. string.Comma( 987654321, "." ) )
Output:
$987.654.321

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...