Content added Content deleted
Horblegorble (talk | contribs) No edit summary |
Horblegorble (talk | contribs) mNo edit summary |
||
Line 28: | Line 28: | ||
|- |
|- |
||
| <nowiki>{{Bool|}}</nowiki> || {{Bool|}} |
| <nowiki>{{Bool|}}</nowiki> || {{Bool|}} |
||
|- |
|||
| <nowiki>{{Bool|}}</nowiki> || {{Bool| }} |
|||
|- |
|- |
||
| <nowiki>{{Bool|1}}</nowiki> || {{Bool|1}} |
| <nowiki>{{Bool|1}}</nowiki> || {{Bool|1}} |
Revision as of 18:38, 12 August 2023
Case-insensitive conversion of 'truthy' and 'falsey' input to '1' or '0' (after whitespace trimming).
No input -> 'none'
All other input -> 'undefined'
Intended for use in `#ifexpr` templates.
e.g. {{#ifexpr: {{Bool | {{{input}}} }} | true | false }}
input-output table:
input | output |
---|---|
{{Bool|}} | none |
{{Bool|1}} | 1 |
{{Bool|0}} | 0 |
{{Bool|yes}} | 1 |
{{Bool|no}} | 0 |
{{Bool|true}} | 1 |
{{Bool|false}} | 0 |
{{Bool|Yes}} | 1 |
{{Bool|YES}} | 1 |
{{Bool|No}} | 0 |
{{Bool|NO}} | 0 |
{{Bool|True}} | 1 |
{{Bool|TRUE}} | 1 |
{{Bool|False}} | 0 |
{{Bool|FALSE}} | 0 |
{{Bool| yes}} | 1 |
{{Bool|yes }} | 1 |
{{Bool| yes }} | 1 |
{{Bool|other}} | UNDEFINED |