Template:Valid: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>SkyLined
More examples
meta>SkyLined
Added option for number to be surrounded by parenthesis
Line 9: Line 9:
:<code><nowiki>{{valid|number=+1234}}</nowiki></code> = {{valid|number=+1234}}
:<code><nowiki>{{valid|number=+1234}}</nowiki></code> = {{valid|number=+1234}}
:<code><nowiki>{{valid|number=-1234}}</nowiki></code> = {{valid|number=-1234}}
:<code><nowiki>{{valid|number=-1234}}</nowiki></code> = {{valid|number=-1234}}
:<code><nowiki>{{valid|number=(1234)}}</nowiki></code> = {{valid|number=(1234)}} ''(one pair of parenthesis is allowed)''
:<code><nowiki>{{valid|number=--1234}}</nowiki></code> = {{valid|number=--1234}} ''(incorrect sign use)''
:<code><nowiki>{{valid|number=--1234}}</nowiki></code> = {{valid|number=--1234}} ''(incorrect sign use)''
:<code><nowiki>{{valid|number=1234567890}}</nowiki></code> = {{valid|number=1234567890}}
:<code><nowiki>{{valid|number=1234567890}}</nowiki></code> = {{valid|number=1234567890}}
Line 14: Line 15:
:<code><nowiki>{{valid|number=1.234567890}}</nowiki></code> = {{valid|number=1.234567890}}
:<code><nowiki>{{valid|number=1.234567890}}</nowiki></code> = {{valid|number=1.234567890}}
:<code><nowiki>{{valid|number=1.2345678901234567890}}</nowiki></code> = {{valid|number=1.2345678901234567890}} ''(too many decimals)''
:<code><nowiki>{{valid|number=1.2345678901234567890}}</nowiki></code> = {{valid|number=1.2345678901234567890}} ''(too many decimals)''
</noinclude><includeonly>{{#if:{{{number|}}}|{{#ifeq:{{{number}}}|{{evalns|{{{number}}}}}|true|{{#ifeq:{{{number}}}|+{{evalns|{{{number}}}}}|true|false}}}}}}</includeonly>
</noinclude><includeonly>{{#if:{{{number|}}}|{{#ifeq:{{{number}}}|{{evalns|{{{number}}}}}|true|{{#ifeq:{{{number}}}|+{{evalns|{{{number}}}}}|true||{{#ifeq:{{{number}}}|({{evalns|{{{number}}}}})|true|false}}}}}}}}</includeonly>

Revision as of 17:17, 16 April 2008

Purpose

Determines whether something is valid in a vertain context. Currently only implemented for determining if a number is within the precision that wikipedia expressions can handle.

Returns

true if the argument is valid, false if it is not.

Examples

{{valid|number=A}} = (not a number)
{{valid|number=1234}} = true
{{valid|number=+1234}} = true
{{valid|number=-1234}} = true
{{valid|number=(1234)}} = (one pair of parenthesis is allowed)
{{valid|number=--1234}} = (incorrect sign use)
{{valid|number=1234567890}} = true
{{valid|number=12345678901234567890}} = (too large)
{{valid|number=1.234567890}} = true
{{valid|number=1.2345678901234567890}} = (too many decimals)