Difference between revisions of "Template:SI prefix"
From Kerbal Space Program Wiki
(Created page with "<includeonly>{{#switch: {{#ifexpr: {{{1}}}<1e-9|-9|{{#ifexpr: {{{1}}}>1e12|12|{{#expr: floor(ln {{{1}}}/ln 10)}}}}}} |-9 |-8 |-7 = {{#expr: {{{1}}}*1000000000 round {{{2|2}}}}...") |
m (!shifted k,M,G,T;) |
||
Line 9: | Line 9: | ||
|-2 = {{#expr: {{{1}}}*100 round {{{2|2}}}}} {{Dict|c}} | |-2 = {{#expr: {{{1}}}*100 round {{{2|2}}}}} {{Dict|c}} | ||
|-1 = {{#expr: {{{1}}}*10 round {{{2|2}}}}} {{Dict|d}} | |-1 = {{#expr: {{{1}}}*10 round {{{2|2}}}}} {{Dict|d}} | ||
− | | 0 | + | | 0 |
| 1 | | 1 | ||
− | | 2 | + | | 2 = {{#expr: {{{1}}} round {{{2|2}}}}} |
− | + | | 3 | |
| 4 | | 4 | ||
− | | 5 | + | | 5 = {{#expr: {{{1}}}/1000 round {{{2|2}}}}} {{Dict|k}} |
− | + | | 6 | |
| 7 | | 7 | ||
− | | 8 | + | | 8 = {{#expr: {{{1}}}/1000000 round {{{2|2}}}}} {{Dict|M}} |
− | + | | 9 | |
|10 | |10 | ||
− | |11 | + | |11 = {{#expr: {{{1}}}/1000000000 round {{{2|2}}}}} {{Dict|G}} |
|12 = {{#expr: {{{1}}}/1000000000000 round {{{2|2}}}}} {{Dict|T}} | |12 = {{#expr: {{{1}}}/1000000000000 round {{{2|2}}}}} {{Dict|T}} | ||
}}</includeonly><noinclude>Returns the value with the corresponding SI prefix. Only the unit needs to be added. Supports the prefixes from <tt>nano</tt> (10⁻⁹) to <tt>tera</tt> (10⁺¹²), except deca (10¹) and hecto (10²). It round to the number of places given in the second parameter which defaults to 2. | }}</includeonly><noinclude>Returns the value with the corresponding SI prefix. Only the unit needs to be added. Supports the prefixes from <tt>nano</tt> (10⁻⁹) to <tt>tera</tt> (10⁺¹²), except deca (10¹) and hecto (10²). It round to the number of places given in the second parameter which defaults to 2. | ||
[[Category:Calculating templates]]</noinclude> | [[Category:Calculating templates]]</noinclude> |
Revision as of 23:59, 20 April 2014
Returns the value with the corresponding SI prefix. Only the unit needs to be added. Supports the prefixes from nano (10⁻⁹) to tera (10⁺¹²), except deca (10¹) and hecto (10²). It round to the number of places given in the second parameter which defaults to 2.