From Nookipedia, the Animal Crossing wiki

This is the documentation page for Module:Formatnum

Module documentation (view)

This module provides a number formatting function. This function can be used from #invoke or from other Lua modules.

Use from other Lua modules

To use the module from normal wiki pages, no special preparation is needed. If you are using the module from another Lua module, first you need to load it, like this:

local mf = require('Module:Formatnum')

(The mf variable stands for Module Formatnum; you can choose something more descriptive if you prefer.)

Most functions in the module have a version for Lua and a version for #invoke. It is possible to use the #invoke functions from other Lua modules, but using the Lua functions has the advantage that you do not need to access a Lua frame object. Lua functions are preceded by _, whereas #invoke functions are not.


mf.formatNum(x, lang, prec, sep)
Small Wikipedia logo.png This page uses content from Wikipedia. The original article was at Module:Formatnum. The list of authors can be seen in the page history. As with Nookipedia, the text of Wikipedia is available under the Creative Commons Attribution-ShareAlike 3.0 Unported license.