Jump to content

Help:Calculation: Difference between revisions

From Meta, a Wikimedia project coordination wiki
Content deleted Content added
With the WikiMedia extension ParserFunctions one can do computations.
No edit summary
Line 1: Line 1:
With the WikiMedia extension [[ParserFunctions]] one can do computations.
With the WikiMedia extension [[ParserFunctions]] one can do computations.

==Numbers==
In the numbers in submitted expressions a decimal point is allowed, and a non-integer result has a decimal point in it. However, commas are neither accepted in input nor produced in output. This applies even though e.g. <nowiki>{{NUMBEROFARTICLES}}</nowiki> uses comma delimiters every three digits, and in some localized versions of MediaWiki point delimiters.

Scientific notation is produced (see [[Template talk:Pow]]), but not accepted as input).


==Without the extension==
==Without the extension==

Revision as of 01:07, 19 April 2006

With the WikiMedia extension ParserFunctions one can do computations.

Numbers

In the numbers in submitted expressions a decimal point is allowed, and a non-integer result has a decimal point in it. However, commas are neither accepted in input nor produced in output. This applies even though e.g. {{NUMBEROFARTICLES}} uses comma delimiters every three digits, and in some localized versions of MediaWiki point delimiters.

Scientific notation is produced (see Template talk:Pow), but not accepted as input).

Without the extension

One can use a piped link to a calculation with Google's calculator, with the label as answer, to demonstrate the numbers used in the computation. This way one can check for consistency, see the result with a higher accuracy, and also conveniently update the result.

E.g., in the case of the population density in the Netherlands:

[[google:16318199/33883|482/km²]], giving 482/km².

With a suitable browser the evaluated expression pops up, so the link is useful even without following it.

Suppose that someone updates the population figure but not the density, than the next person can see that the density is not based on the latest figure, replace the first number, press Preview, follow the link, copy the new result to the link label, and save. Thus the update requires a minimum of effort.

Unfortunately, the result 482 has to be entered manually and consistency is not automatically maintained.

Without putting the result on the page

Alternatively, the user has to follow the link to see the result. Using template:popd is convenient and there is no redundancy, hence no worry about consistency:

{{popd|16318199|33883}} gives:

See also