Module:Addcommas/doc

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to navigation Jump to search

This is the documentation page for Module:Addcommas

This is a documentation subpage for Module:Addcommas.
It contains usage information, categories, and other content that is not part of the original module page.
Module:Addcommas requires Module:Arguments.
Module:Addcommas requires libraryUtil.
Module:Addcommas is required by .
Function list
L 11 — p._add
L 47 — p._strip
L 52 — p.commas

This module is a helper module to be used by other modules; it may not be designed to be invoked directly. See RuneScape:Lua/Helper modules for a full list and more information.

FunctionTypeUse
_add( num )number/stringReturns a string with num formatted with commas. Also works on ranges of numbers; e.g. '10000-100000' -> '10,000-100,000'
_strip( num )stringReturns a string with all commas removed from num.

Example:

local commas = require('Module:Addcommas')
mw.log(commas._add(100000)) --> '100,000'
mw.log(commas._strip('100,000')) --> '100000'