View source for Module:Params
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
--- ---
--- LOCAL ENVIRONMENT ---
--- ________________________________ ---
--- ---
--[[ Abstract utilities ]]--
----------------------------
-- Helper function for `string.gsub()` (for managing zero-padded numbers)
local function zero_padded (str)
return ('%03d%s'):format(#str, str)
end
-- Helper function for `table.sort()` (for natural sorting)
local function natural_sort (var1, var2)
return tostring(var1):gsub('%d+', zero_padded) <
tostring(var2):gsub('%d+', zero_padded)
end
000
1:0
Template used on this page:
Return to Module:Params.