Help talk:Variable
From Wikipedia, the free encyclopedia
[edit] Localtime
Maybe there is a mistake in Section Local Time... should the Variables for Localtime be LOCALTIME? Not CURRENTTIME? This is the same as above. —Preceding unsigned comment added by 145.253.2.27 (talk) 10:26, 19 May 2008 (UTC)
[edit] Function ns allows end text
24-Sep-2007: I've been testing the namespace function 'ns' for use as a numeric-validation trick for numbers above 20 (as in "{{ns: 12,567}}"), and it returns "Help" or "Talk" or "Category_talk" when letters or commas are inside a number. When the data begins with a letter, then function 'ns' tries to call the named template; however, it accepts ending letters/commas as okay in numeric data. Some examples:
-
- {{ns: 12567}} returns "" (empty string, valid number);
- {{ns: 12,567}} returns "Help" (not numeric);
- {{ns: 12x567}} returns "Help" (not numeric);
- {{ns: 1}} returns "Talk" (NOT valid number);
- {{ns: 4}} returns "Wikipedia" (INVALID number);
- {{ns: 12}} returns "Help" (INVALID number);
- {{ns: 120}} returns "" (valid number);
- {{ns: 21}} returns "" (valid number);
- {{ns: 567ab}} returns "" (valid number);
- {{ns: 567px}} returns "" (valid number);
-
-
- Function 'ns' cannot detect "px" ending a size parameter.
-
- {{ns: 567,}} returns "" (valid number);
-
-
- Apparently, text/commas after a number are allowed (!).
-
- {{ns: 12xx567}} returns "Help" (not numeric);
- {{ns: a12567}} returns "Template:Ns: a12567" (not numeric);
- {{ns: a12,567}} returns "Template:Ns: a12,567" (not numeric);
-
-
- Apparently, leading alpha causes the named template to be called.
- So "one man's bug is another man's feature bizarro".
-
- {{ns: mydog2}} returns "Template:Ns: mydog2" (not numeric);
- {{ns: ,12,567}} returns "Template:Ns: ,12,567" (not numeric);
- {{ns: 12,567,000}} returns "Help" (not numeric);
- {{ns: 12567000}} returns "" (valid number);
- {{ns: 12.567}} returns "Help" (NOT numeric!!);
-
-
- Apparently, some valid decimal fraction numbers are rejected (!).
-
- {{ns: 12.056}} returns "Help" (not numeric!);
- {{ns: 12.05}} returns "Help" (not numeric!);
- {{ns: 12567.000}} returns "" (valid);
- {{ns: 12567.0}} returns "" (valid);
The above 23 examples show that function 'ns' works for numeric validation, somewhat (rejecting decimal "12.567"), but it is peculiar, and I would consider the passing of "567px" (as numeric) to be another software bug in 'ns' as failing to detect non-numeric "px" ending a number. However, function 'ns' does catch commas within data (not at end). -Wikid77 12:16, 25 September 2007 (UTC)
[edit] Template:USERNAME
Is there not, and if not why can't we have, a variable taking the user who is reading the page's username? There is on Uncyclopedia. Jake the Editor Man (talk) 12:15, 9 December 2007 (UTC)

