Search results
Results from the WOW.Com Content Network
-- This module is intended to replace the functionality of Template:Formatnum and related templates. local p = {} function p. main (frame) local args = frame: getParent (). args local prec = args. prec or '' local sep = args. sep or '' local number = args [1] or args. number or '' local lang = args [2] or args. lang or ''-- validate the language parameter within MediaWiki's caller frame if ...
It also returns nil values as nil, to allow for distinctions between nil and false. The module also accepts other Lua structures as input, i.e. booleans, numbers, tables, and functions. If it is passed input that it does not recognise as boolean or nil, it is possible to specify a default value to return.
This can be any Lua value. This parameter is optional, and defaults to nil. options: A table of options. This parameter is optional. The following options can be specified in the options table: pretty: If true, output the string in "pretty" format (as in pretty-printing). This will add new lines and indentation between table items.
Lua patterns deliberately lack the most complex regular expression constructs (to avoid bloating the Lua code base), where many other computer languages or libraries use a more complete set. Lua patterns are not even a subset of regular expressions, as there are also discrepancies, like Lua using the escape character % instead of \, , and ...
Lua time usage varies 1%-60% depending on busy servers: Although the Lua portion of total reformat time is more stable than markup parsing, which often varies over 200% slower (rarely over 300% slower), the Lua time clock tends to stay within ±20% of the seconds consumed. However, the Lua time usage can also vary wildly, as sometimes +30%, and ...
Takes an array t with one or more nil values, and removes the nil values while preserving the order, so that the array can be safely traversed with ipairs. Any keys that are not positive integers are removed. For example, for the table {1, nil, foo = 'bar', 3, 2}, compressSparseArray will return {1, 3, 2}.
next is a global variable, not a keyword. By default, it references a function — first class objects, remember. — that does iteration over a table. # expects the array convention. If your table isn't adhering to that convention, you'll get funny results. Use nil == next (table) to check for a table being empty. When tonumber fails, it ...
reserved_debug - nonzero value forces display of a not particularly useful debug text; The functioncall is written as some.function.name(a,b,c) where some.function.name means something in the Extension:Scribunto/Lua reference manual and a,b,c are the arbitrary variable names you've chosen.