Template:Valid/doc: Difference between revisions
(Created page with '<noinclude>{{Documentation subpage}}</noinclude> <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> ==Purpose== Determines whether something is valid in a …') |
(add cat) |
||
Line 3: | Line 3: | ||
==Purpose== | ==Purpose== | ||
Determines whether something is valid in a certain context. Currently only implemented for determining if a number is within the precision that | Determines whether something is valid in a certain context. Currently only implemented for determining if a number is within the precision that expressions can handle. | ||
==Returns== | ==Returns== | ||
'''true''' if the argument is valid, '''false''' if it is not. | '''true''' if the argument is valid, '''false''' if it is not. | ||
Line 20: | Line 20: | ||
<includeonly> | <includeonly> | ||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | <!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | ||
[[Category:Metatemplates|{{PAGENAME}}]] | |||
</includeonly> | </includeonly> |
Latest revision as of 11:20, 10 January 2011
![]() |
This is a documentation subpage for Template:Valid (see that page for the template itself). It contains usage information, categories and other content that is not part of the original template page. |
Purpose[edit source]
Determines whether something is valid in a certain context. Currently only implemented for determining if a number is within the precision that expressions can handle.
Returns[edit source]
true if the argument is valid, false if it is not.
Examples[edit source]
{{valid|number=A}}
= false (not a number){{valid|number=1234}}
= true{{valid|number=+1234}}
= true{{valid|number=-1234}}
= true{{valid|number=(1234)}}
= false (one pair of parenthesis is allowed){{valid|number=--1234}}
= false (incorrect sign use){{valid|number=1234567890}}
= true{{valid|number=12345678901234567890}}
= false (too large){{valid|number=1.234567890}}
= true{{valid|number=1.2345678901234567890}}
= false (too many decimals)