Difference between revisions of "Module:Leading zeros"

MyWikiBiz, Author Your Legacy — Tuesday October 21, 2025
Jump to navigationJump to search
(Pywikibot 6.4.0)
 
(No difference)

Latest revision as of 23:31, 15 July 2021

Template:Module rating This module is created for Template:SEHK. It is able to strip all leading zeros from the value (0001 to 1), while showing "Incorrect" as a error message when a non-numeric value is inputted. This module can be implemented to different template, if applicable.

Usage

{{#invoke:Leading zeros |stripzeros |"number-goes-here"}}


p = {}
p.stripzeros = function(frame)
	x = tonumber(frame.args[1])
	if x then
		return x
	else
		return "Incorrect"
	end
end
return p