Jump to content

Module:Spellnum per MOS/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m DannyS712 moved page Module:ConvertNumericPerMOS/doc to Module:Spellnum per MOS/doc without leaving a redirect: requested move; consensus at Module talk:Spellnum per MOS
Usage: Give usage from Lua
Line 5: Line 5:


<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|main|''number to format''|''if second arg equals 1, prefer numerals''}}</code>
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|main|''number to format''|''if second arg equals 1, prefer numerals''}}</code>

For use by other Lua modules:

<syntaxhighlight lang="lua">
local spellnum = require('Module:Spellnum per MOS').spellnum
spellnum{ 11 } -- returns 'eleven'
</syntaxhighlight>

Note that the "zero" option defaults to blank which is probably not what you want.


<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |

Revision as of 10:45, 1 April 2021

{{Module rating }}

Usage

Implements Template:Spellnum per MOS.

{{#invoke:Spellnum per MOS|main|number to format|if second arg equals 1, prefer numerals}}

For use by other Lua modules:

local spellnum = require('Module:Spellnum per MOS').spellnum
spellnum{ 11 } -- returns 'eleven'

Note that the "zero" option defaults to blank which is probably not what you want.