<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.midsouthmakers.org/index.php?action=history&amp;feed=atom&amp;title=Template%3ACalculate_increment%2Fdoc</id>
	<title>Template:Calculate increment/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.midsouthmakers.org/index.php?action=history&amp;feed=atom&amp;title=Template%3ACalculate_increment%2Fdoc"/>
	<link rel="alternate" type="text/html" href="http://wiki.midsouthmakers.org/index.php?title=Template:Calculate_increment/doc&amp;action=history"/>
	<updated>2026-04-30T17:36:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://wiki.midsouthmakers.org/index.php?title=Template:Calculate_increment/doc&amp;diff=343&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://wiki.midsouthmakers.org/index.php?title=Template:Calculate_increment/doc&amp;diff=343&amp;oldid=prev"/>
		<updated>2010-01-18T17:54:20Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{documentation subpage}}&lt;br /&gt;
&amp;lt;!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What it does ==&lt;br /&gt;
&lt;br /&gt;
Calculates suitable increments for {{tl|scalemarkers}}.&lt;br /&gt;
Increments are 1, 2 or 5 times an appropriate power of 10.&lt;br /&gt;
&lt;br /&gt;
Variable 1 = from;&lt;br /&gt;
Variable 2 = to.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
{{evd|calculate increment|10|30}}&lt;br /&gt;
&lt;br /&gt;
== Problems it has ==&lt;br /&gt;
&lt;br /&gt;
It doesn&amp;#039;t deal with small (&amp;lt;10) scales yet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How it does it ==&lt;br /&gt;
&lt;br /&gt;
First we need to select the &amp;quot;base value&amp;quot; - i.e. what we&amp;#039;re going to multiply by the power of 10.&lt;br /&gt;
We use the following brackets:&lt;br /&gt;
:14&amp;lt;35: 20&lt;br /&gt;
:35-70 : 50&lt;br /&gt;
:70-&amp;gt;14: 10&lt;br /&gt;
&lt;br /&gt;
To generate the first two digits is quite laborious. This code generates a suitably rounded number; we need to divide that by 10 &amp;#039;&amp;#039;n&amp;#039;&amp;#039; times.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{{{3|1}}} round (2-{{len|{{#expr:abs ({{{1|0}}} - {{{2|1}}})}}}})}}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{#expr:&lt;br /&gt;
&lt;br /&gt;
( {{#expr:abs ({{{1|0}}} - {{{2|1}}})}} round (2-{{len|{{#expr:abs ({{{1|0}}} - {{{2|1}}})}}}})) &lt;br /&gt;
&lt;br /&gt;
/ &lt;br /&gt;
&lt;br /&gt;
( 1&lt;br /&gt;
   {{#if:&lt;br /&gt;
      {{#expr: ({{len|{{#expr:abs ({{{1|0}}} - {{{2|1}}})}}}} - 1) &amp;gt;= 0 }}|&lt;br /&gt;
      {{loop|{{#expr: ({{len|{{#expr:abs ({{{1|0}}} - {{{2|1}}})}}}} - 1)}}|/10}}|&lt;br /&gt;
      {{loop|-{{#expr: ({{len|{{#expr:abs ({{{1|0}}} - {{{2|1}}})}}}} - 1)}}|*10}}&lt;br /&gt;
    }}&lt;br /&gt;
)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then we need to select the power of 10.&lt;br /&gt;
&lt;br /&gt;
{{#expr: ({{len|{{#expr:abs ({{{1|0.1}}} - {{{2|10}}})}}}} - 1)}}; &lt;br /&gt;
{{#expr:&lt;br /&gt;
    {{#if:&lt;br /&gt;
      {{#expr: ({{len|{{#expr:abs ({{#expr:abs {{{1|00}}}}} - {{#expr:abs {{{2|1}}}}})}}}} - 1) &amp;gt;= 0 }}|&lt;br /&gt;
      10 {{loop|{{#expr: ({{len|{{#expr:abs ({{#expr:abs {{{1|00}}}}} - {{#expr:abs {{{2|1}}}}})}}}} - 2)}}|*10}}|&lt;br /&gt;
      10 {{loop|-{{#expr: ({{len|{{#expr:abs ({{#expr:abs {{{1|00}}}}} - {{#expr:abs {{{2|1}}}}})}}}} - 2)}}|/10}}&lt;br /&gt;
    }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
[[Category:Mathematical function templates]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>