Template:Crop: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
No edit summary
m (Add doc template)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!--{{#ifexpr: {{{1}}} >= 1000
{{#ifexpr: {{formatnum:{{{1|0}}}|R}} >= 1000000 | {{#expr: {{formatnum:{{{1|0}}}|R}}/1000000 round 1}}m | {{#ifexpr: {{formatnum:{{{1|0}}}|R}} >= 1000 | {{#expr: {{formatnum:{{{1|0}}}|R}}/1000 round 1}}k | {{{1|0}}} }} }}<noinclude>{{Documentation}}</noinclude>
| {{#ifeq: {{#sub: {{#expr: {{{1}}}/1000}} | {{#expr: {{#pos: {{#expr: {{{1}}}/1000}} |.}} + 2}} | 1 }} | 5
    | {{#ifeq: {{#pos:{{{1}}}|.}} | | {{#expr: {{#sub: {{#expr: {{{1}}}/1000}} | 0 | -2}} + 0.1 }} | {{#expr: {{#sub: {{#expr: {{{1}}}/1000}} | 0 | -3}} + 0.1 }} }}
   
    | {{#ifeq: {{#pos:{{{1}}}|.}} | | {{#sub: {{#expr: {{{1}}}/1000}} | 0 | -2}}| {{#sub: {{#expr: {{{1}}}/1000}} | 0 | -3}} }} 
 
  }}k  
 
| {{{1}}}  
}}-->
{{#ifexpr: {{{1}}} >= 1000
| {{#expr: {{{1}}}/1000 round 1}}k
 
| {{{1}}}
}}

Latest revision as of 21:25, 6 June 2017

0

[View] [Edit] [Page history]

Documentation

This is a simple template that will take a large number, such as 23,000, and turn it into 23k.

Example:

{{Crop|23000}}

Makes:

23k
List of all templates