View source for Module:BaseConvert
From The Goon Show Depository
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
local p = {}
local digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
local function normalizeFullWidthChars(s)
return mw.ustring.gsub(s, '[!-~]', function(s)
return mw.ustring.char(mw.ustring.codepoint(s, 1) - 0xFEE0)
end)
end
local function _convert(n, base, from, precision, width, default, prefix, suffix)
n = tostring(n)
-- strip off any leading '0x' (unless x is a valid digit in the input base)
from = tonumber(from)
if not from or from < 34 then
local c
n, c = n:gsub('^(-?)0[Xx]', '%1')
if c > 0 and not from then from = 16 end
end
000
1:0
Template used on this page:
Return to Module:BaseConvert.