Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
MediaWiki help
Creopedia
Search
Search
Appearance
Log in
Personal tools
Log in
View source for Module:Money
Module
Discussion
English
Read
View source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
View source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
←
Module:Money
require( 'strict' ) local iconText = require( 'Module:IconText' ) local p = {} --- Render the money text --- --- @param moneyNum number --- @return string local function renderMoney( moneyNum ) local lang = mw.language.getContentLanguage() return iconText._main( { icon = 'General money icon.png', text = lang:formatNum( moneyNum ), class = 't-money cp-image-pixelated' } ) end --- Wikitext entry point for the module --- --- @param frame mw.frame --- @return string function p.main( frame ) local getArgs = require( 'Module:Arguments' ).getArgs return p._main( getArgs( frame )[1] ) end --- Render the money text --- --- @param money string|number --- @return string function p._main( money ) local moneyNum = tonumber( money ) if not moneyNum then error( 'Invalid money value: ' .. money ) end return mw.getCurrentFrame():extensionTag { name = 'templatestyles', args = { src = 'Module:Money/styles.css' } } .. renderMoney( moneyNum ) end return p
Templates used on this page:
Template:Documentation
(
view source
)
Module:Money/doc
(
view source
)
Return to
Module:Money
.