Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Utility/doc

From Kronopolis and the Flat Plane

This is the documentation page for Module:Utility

Usage

Import: local util = require('Module:Utility')

Functions

dump

Turn a table into a string.

dump(table)
Return type: string

Example

local table = {
    dong = 'biggest',
    description = 'schlong'
}
local str = dump(table)

Returns:

{ 
["dong "] = biggest,
["description"] = schlong,
}

firstToUpper

Capitalize first character in a string.

firstToUpper(string)
Return type: string

Example

local dong = firstToUpper("donger")

Returns:

dong = "Donger"

formatLevel

Get a formatted level based on an integer.

formatLevel(integer)
Return type: string

Example

local lv = formatLevel(0)
local lv1 = formatLevel(1)
local lv2 = formatLevel(2)

Returns:

lv = "cantrip"
lv1 = "1st"
lv2 = "2nd"