<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://kryptowiki.eu/index.php?action=history&amp;feed=atom&amp;title=Modul%3ADecimals</id>
	<title>Modul:Decimals - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://kryptowiki.eu/index.php?action=history&amp;feed=atom&amp;title=Modul%3ADecimals"/>
	<link rel="alternate" type="text/html" href="https://kryptowiki.eu/index.php?title=Modul:Decimals&amp;action=history"/>
	<updated>2026-11-21T07:44:41Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Kryptowiki - Die freie Enzyklopädie der Kryptowährungen</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>https://kryptowiki.eu/index.php?title=Modul:Decimals&amp;diff=706&amp;oldid=prev</id>
		<title>C1ph4: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://kryptowiki.eu/index.php?title=Modul:Decimals&amp;diff=706&amp;oldid=prev"/>
		<updated>2017-08-18T18:18:20Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require('Module:No globals')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._main(n, d)&lt;br /&gt;
	local num = tonumber(n)&lt;br /&gt;
	if not num then&lt;br /&gt;
		error('Unable to convert &amp;quot;' .. tostring(n) .. '&amp;quot; to a number')&lt;br /&gt;
	end&lt;br /&gt;
	local decimals = tonumber(d)&lt;br /&gt;
	if not decimals then&lt;br /&gt;
		error('Unable to convert &amp;quot;' .. tostring(d) .. '&amp;quot; to a number')&lt;br /&gt;
	end&lt;br /&gt;
	local maxDecimals = 14 - math.floor(math.log10(num)) -- to allow a maximum of 15 significant figures, which is the highest guaranteed correct with doubles&lt;br /&gt;
	if decimals &amp;gt; maxDecimals then decimals = maxDecimals end&lt;br /&gt;
	local mult = 10^decimals&lt;br /&gt;
	num = math.floor(num * mult + 0.5) / mult&lt;br /&gt;
	if decimals &amp;lt; 0 then&lt;br /&gt;
		return tostring(num)&lt;br /&gt;
	else&lt;br /&gt;
		return string.format('%.' .. decimals .. 'f', num)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args, pargs = frame.args, frame:getParent().args&lt;br /&gt;
	return p._main(mw.ext.ParserFunctions.expr(args[1] or pargs[1]), mw.ext.ParserFunctions.expr(args[2] or pargs[2]))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>C1ph4</name></author>
	</entry>
</feed>