Difference between revisions of "Template:Cells"

From LifeWiki
Jump to navigation Jump to search
(Created page with "<includeonly>{{#if: {{{cells|{{{1|}}}}}} | [[:Category:Patterns with {{{cells|{{{1|}}}}}} cells|{{{cells|{{{1|}}}}}}]] | '''no cell count specified!''' }}</includeonly><noincl...")
 
(attempt to use formatnum so that thousands separators are allowed and the number will still be interpreted correctly)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>{{#if: {{{cells|{{{1|}}}}}} | [[:Category:Patterns with {{{cells|{{{1|}}}}}} cells|{{{cells|{{{1|}}}}}}]] | '''no cell count specified!''' }}</includeonly><noinclude>{{Template:Cells/Doc}} [[Category:Templates]]</noinclude>
+
<includeonly>{{#if: {{{cells|{{{1|}}}}}} | {{#ifexpr: {{formatnum:{{{cells|{{{1|}}}}}}|R}} >= 1000 | [[:Category:Patterns with 1000 or more cells|{{{cells|{{{1|}}}}}}]] | [[:Category:Patterns with {{{cells|{{{1|}}}}}} cells|{{{cells|{{{1|}}}}}}]] }} | '''no cell count specified!''' }}</includeonly><noinclude>{{Template:Cells/Doc}} [[Category:Templates]]</noinclude>

Latest revision as of 12:55, 14 February 2020

This template can be used to quickly and easily embed a link to the category of patterns with a given cell count. For example,

The frobnozzle is a {{cells|22}}-bit p3 oscillator.

becomes

The frobnozzle is a 22-bit p3 oscillator.

(This is much more convenient than having to type the equivalent of

The frobnozzle is a [[:Category:Patterns with 22 cells]]-bit p3 oscillator.

everytime you want to link to a cell count-based pattern category.)

The template takes a single parameter, which can be passed without a name or as cells=.