<?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%3ARangemap%2Fdoc</id>
	<title>Template:Rangemap/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%3ARangemap%2Fdoc"/>
	<link rel="alternate" type="text/html" href="http://wiki.midsouthmakers.org/index.php?title=Template:Rangemap/doc&amp;action=history"/>
	<updated>2026-04-30T19:09:32Z</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:Rangemap/doc&amp;diff=361&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://wiki.midsouthmakers.org/index.php?title=Template:Rangemap/doc&amp;diff=361&amp;oldid=prev"/>
		<updated>2010-01-18T17:54:22Z</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;!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&amp;lt;pre&amp;gt;{{rangemap&lt;br /&gt;
| value =  the number to map&lt;br /&gt;
| from_low = the lower bound of the value&amp;#039;s current range&lt;br /&gt;
| from_high = the upper bound of the value&amp;#039;s current range&lt;br /&gt;
| to_low = the lower bound of the value&amp;#039;s target range&lt;br /&gt;
| to_high = the upper bound of the value&amp;#039;s target range&lt;br /&gt;
| precision = the number of decimals to round to&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
or, without specifying argument names:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{rangemap|value|from_low|from_high|to_low|to_high}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
Re-maps a number from one range to another. That is, a value of from_low would get mapped to to_low, a value of from_high to to_high, values in-between to values in-between, etc.&lt;br /&gt;
&lt;br /&gt;
Does not constrain values to within the range, because out-of-range values are sometimes intended and useful. &amp;lt;!--The constrain() function may be used either before or after this function, if limits to the ranges are desired.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;quot;lower bounds&amp;quot; of either range may be larger or smaller than the &amp;quot;upper bounds&amp;quot; so this template may be used to reverse a range of numbers, for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{rangemap|{{{x}}}|1|50|50|1}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The template also handles negative numbers well, so that this example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{rangemap|{{{x}}}|1|50|50|-100)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is also valid and works well.&lt;br /&gt;
== Appendix ==&lt;br /&gt;
&lt;br /&gt;
For the mathematically inclined, here&amp;#039;s the expression:&lt;br /&gt;
 (value - from_low) * (from_high - from_low) / (to_high - to_low) + to_low&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&amp;lt;!-- CATEGORIES AND INTERWIKIS HERE, THANKS --&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>