<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="it">
	<id>https://gears.worldongames.it/quattrogatti/index.php?action=history&amp;feed=atom&amp;title=Modulo%3AConversione</id>
	<title>Modulo:Conversione - Cronologia</title>
	<link rel="self" type="application/atom+xml" href="https://gears.worldongames.it/quattrogatti/index.php?action=history&amp;feed=atom&amp;title=Modulo%3AConversione"/>
	<link rel="alternate" type="text/html" href="https://gears.worldongames.it/quattrogatti/index.php?title=Modulo:Conversione&amp;action=history"/>
	<updated>2026-05-19T06:37:16Z</updated>
	<subtitle>Cronologia della pagina su questo sito</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://gears.worldongames.it/quattrogatti/index.php?title=Modulo:Conversione&amp;diff=28&amp;oldid=prev</id>
		<title>GughyXIV: una versione importata</title>
		<link rel="alternate" type="text/html" href="https://gears.worldongames.it/quattrogatti/index.php?title=Modulo:Conversione&amp;diff=28&amp;oldid=prev"/>
		<updated>2022-10-04T12:56:54Z</updated>

		<summary type="html">&lt;p&gt;una versione importata&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versione delle 14:56, 4 ott 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;it&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Nessuna differenza)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>GughyXIV</name></author>
	</entry>
	<entry>
		<id>https://gears.worldongames.it/quattrogatti/index.php?title=Modulo:Conversione&amp;diff=27&amp;oldid=prev</id>
		<title>wikipedia&gt;Rotpunkt: tipo valore di ritorno</title>
		<link rel="alternate" type="text/html" href="https://gears.worldongames.it/quattrogatti/index.php?title=Modulo:Conversione&amp;diff=27&amp;oldid=prev"/>
		<updated>2015-10-30T09:40:05Z</updated>

		<summary type="html">&lt;p&gt;tipo valore di ritorno&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nuova pagina&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
* Modulo per effettuare la conversione di unità di misura.&lt;br /&gt;
*&lt;br /&gt;
* Ampiamente modificato a partire da:&lt;br /&gt;
* http://fr.wikipedia.org/w/index.php?title=Module:Conversion&amp;amp;oldid=118515752&lt;br /&gt;
]]--&lt;br /&gt;
&lt;br /&gt;
require('Modulo:No globals')&lt;br /&gt;
&lt;br /&gt;
local cfg = mw.loadData('Modulo:Conversione/Configurazione')&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Ritorna il numero arrotondato al numero di cifre decimali richiesto&lt;br /&gt;
-- http://lua-users.org/wiki/SimpleRound&lt;br /&gt;
local function round(num, idp)&lt;br /&gt;
	local mult = 10 ^ (idp or 0)&lt;br /&gt;
	return math.floor(num * mult + 0.5) / mult&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getUnit(val, targetunitdata, args)&lt;br /&gt;
	local ret, link, space&lt;br /&gt;
&lt;br /&gt;
	if args.showunit then&lt;br /&gt;
		ret = targetunitdata.symbol&lt;br /&gt;
	elseif args.showunitlong then&lt;br /&gt;
	 	-- unità per esteso&lt;br /&gt;
		ret = val &amp;gt; 1 and targetunitdata.name2 or targetunitdata.name1&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if args.showunitlink then&lt;br /&gt;
		link = targetunitdata.link&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	space = (args.showunit and targetunitdata.nospace) and '' or ' '&lt;br /&gt;
&lt;br /&gt;
	return space .. (link and '[[' .. link .. '|' .. ret .. ']]' or ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Ritorna il valore convertito alla unità di misura e alle opzioni specificate&lt;br /&gt;
function p._main(strval, sourceunit, targetunit, args)&lt;br /&gt;
	local val, sourceunitdata, targetunitdata, cat&lt;br /&gt;
&lt;br /&gt;
	val = tonumber(strval)&lt;br /&gt;
	-- se non è un numero ritorna la stringa non modificata&lt;br /&gt;
	if not val then&lt;br /&gt;
		return strval&lt;br /&gt;
	end&lt;br /&gt;
	if not args then&lt;br /&gt;
		args = {}&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if sourceunit and not targetunit then&lt;br /&gt;
		targetunit = sourceunit&lt;br /&gt;
	end&lt;br /&gt;
	sourceunitdata = cfg.units[sourceunit] or cfg.units[cfg.alias[sourceunit]]&lt;br /&gt;
	targetunitdata = cfg.units[targetunit] or cfg.units[cfg.alias[targetunit]]&lt;br /&gt;
	if sourceunitdata and targetunitdata then&lt;br /&gt;
		if sourceunitdata.type ~= targetunitdata.type then&lt;br /&gt;
			error('unità di misura incompatibili: ' .. sourceunitdata.type .. ' e ' .. targetunitdata.type)&lt;br /&gt;
		end&lt;br /&gt;
		if sourceunitdata == targetunitdata then&lt;br /&gt;
			-- nothing&lt;br /&gt;
		elseif sourceunitdata.type == 'temperature' then&lt;br /&gt;
			val = (val - sourceunitdata.offset) * sourceunitdata.scale&lt;br /&gt;
			val = val / targetunitdata.scale + targetunitdata.offset&lt;br /&gt;
		else&lt;br /&gt;
			val = val * sourceunitdata.scale / targetunitdata.scale&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		cat = '[[Categoria:Pagine con unità di misura non supportata]]'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- arrotondamento&lt;br /&gt;
	if args.rounding then&lt;br /&gt;
		val = round(val, args.rounding)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- formatnum&lt;br /&gt;
	if args.formatnum then&lt;br /&gt;
		val = mw.language.getContentLanguage():formatNum(val)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- unità di misura&lt;br /&gt;
	if targetunitdata and (args.showunit or args.showunitlong) then&lt;br /&gt;
		val = val .. getUnit(val, targetunitdata, args)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return val .. (cat or '')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Entry-point per {{#invoke:Conversione|main|...}}&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	return p._main(args[1], args[2], args[3], args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Rotpunkt</name></author>
	</entry>
</feed>