Template:Calculate increment/doc
< Template:Calculate increment
Jump to navigation
Jump to search
Revision as of 06:30, 13 September 2011 by imported>Jimp
| 40px | This is a documentation subpage for Template:Calculate increment. It contains usage information, categories and other content that is not part of the original template page. |
Usage
This template takes two numbers and calculates suitable increments for {{scalemarkers}} based on the difference between these numbers. Increments are 1, 2 or 5 times an appropriate power of 10.
Variable 1 = from; Variable 2 = to.
Examples:
How it does it
First we need to select the "base value" - i.e. what we're going to multiply by the power of 10. We use the following brackets:
- 14<35: 20
- 35-70 : 50
- 70->14: 10
This code generates a suitably rounded number; we need to divide that by 10 n times.