Talk:Moon/Row

From Kerbal Space Program Wiki
Revision as of 13:20, 16 March 2015 by XZise (talk | contribs) (Expression error: Unrecognized punctuation character "{".)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Expression error: Unrecognized punctuation character "{".

This occurs at the Sigfigs template. Oddly, erasing one "{" in front of it makes the error quiet down, but near as I can tell that would be one too few "{"s to match the "}"s. So, I think the error may be in how Template:Sigfigs returns things. This is a little technical for me... --Brendan (talk) 23:31, 13 March 2015 (CDT)

Where does the error occur? Looking at your fix I doubt that it works. — xZise [talk] 12:52, 14 March 2015 (CDT)
Revert the fix and it will appear here, and also when all the <noinclue> & <includeonly> tags are removed from the Sigfig template. The numbers parsed through Sigfig seem to all work with my attempted fix, so... what do you think? --Brendan (talk) 12:55, 14 March 2015 (CDT)
You made it to triple brackets which interpret it as a variable: Oh vs. No ({{{#ifexpr: 42 = 0|Oh|No}}} vs. {{#ifexpr: 42 = 0|Oh|No}}). It returns “Oh” in the first case because the variable “#ifexpr: 42 = 0” is not set (although that name doesn't make sense with the equal sign in it). And if a variable is not set it uses the first parameter after it (“Oh”, interestingly it doesn't use everything after the pipe). This here is also a meta template. The data is missing here so it can't show anything useful. If a variable is not set and also no default (e.g. {{{foobar}}}) then it'll display the text unchanged (so {{{foobar}}}) and the curly brackets are not a valid number.
You've now changed it into a variable which seems to have disabled calculating with it and thus no apparent errors. But when I substitute {{sigfigs|1|4}} you see that it's using the scientific notation even though the number is shorter than the given significant figures: 1.000×100xZise [talk] 06:15, 16 March 2015 (CDT)
Okay now after I've reverted it, it's 1.000. And you can also see why it happens: It's trying to get the body's mass using {{Body data|{{{1}}}|mass}}. By default (with no body name given) this will just return {{:{{{1}}}/Param|mass|}} and that is not a valid number which could be used in a calculation. When I replace the {{{1}}} with Mun it will generate “” and that is a valid number which can be used easily.
By the way most pages which are Category:Metatemplates/Category:Page-specific templates also show invalid data by default because they have no default value set (why bother?). — xZise [talk] 08:20, 16 March 2015 (CDT)