Difference between revisions of "Module:RankTable"

Jump to navigation Jump to search
341 bytes added ,  17:33, 19 April 2018
m
fixed the table error and added number formatting because prettier
m (added "Current EXP Total sum of all Ranks")
m (fixed the table error and added number formatting because prettier)
Line 92: Line 92:
}
}


local function formatInteger( number )
if number == "-" then return number end
local i, j, minus, int, fraction = tostring( number ):find( '([-]?)(%d+)([.]?%d*)' )
int = int:reverse():gsub( "(%d%d%d)", "%1," )
return minus .. int:reverse():gsub("^,", "") .. fraction
end
local function CheckEqualValues( tocheck, tosend )
local function CheckEqualValues( tocheck, tosend )
if tocheck and ( tocheck == tosend ) then
if tocheck and ( tocheck == tosend ) then
Line 125: Line 134:
| style="text-align: left;" | ]] .. CheckEqualValues( preval[t], tbl[t] ) .. [[  
| style="text-align: left;" | ]] .. CheckEqualValues( preval[t], tbl[t] ) .. [[  
| style="text-align: left;" | ]] .. CheckEqualValues( preval[f], tbl[f] ) .. [[  
| style="text-align: left;" | ]] .. CheckEqualValues( preval[f], tbl[f] ) .. [[  
| style="text-align: left;" | ]] .. CheckEqualValues( preval[e], tbl[e] ) .. [[  
| style="text-align: left;" | ]] .. formatInteger(CheckEqualValues( preval[e], tbl[e] )) .. [[  
| style="text-align: left;" | ]] .. exptotal .. [[  
| style="text-align: left;" | ]] .. formatInteger( exptotal ) .. [[  
]]
]]


Line 135: Line 144:
wiki_table = wiki_table ..
wiki_table = wiki_table ..
[[
[[
|-
|- style="font-size: 26px;" |
! scope="row" colspan="5"| Current EXP Total sum of all Ranks
| colspan="5" | Current EXP Total sum of all Ranks
| ]] .. exptotal .. [[
| ]] .. formatInteger(exptotal) .. [[
]]
]]


359

edits

Navigation menu