Special property "Display precision of"
Display precision of | |
---|---|
Allows to define the display precision in digits
| |
Further Information | |
Provided by: | extension "Semantic MediaWiki "Allows to store and query data annotated to pages |
Added: | 2.4.0 |
Removed: | still in use |
Alias: | has no alias |
Optional: | no |
Visible: | yes |
Annotable: | yes |
Declarative: | yes |
Key: | _PREC
|
Setting: | not specified |
Focus: | not specified |
In this wiki: | Property:Display precision of |
Table of Contents | |
The Display precision of property is a special property in Semantic MediaWiki with a built-in meaning: it adds the possibility to specify a display precision for numeric datatypes, i.e. datatype "Quantity"Holds values that describe quantities, containing both a number and a unit, datatype "Temperature"Holds temperature values (similar to type Quantity) and datatype "Number"Holds integer and decimal numbers, with an optional exponent. It was introduced starting with Semantic MediaWiki 2.4.0Released on 9 July 2016 and compatible with MW 1.19.0 - 1.27.x..1
See the property page "Display precision of" to see which pages use this special property on this wiki.
Example[edit]
The page of a property called "Has area" might contain:
[[Display precision of::2]]
This will set the display precision for the data values assigned to the respective property to two. Note that rounding applies, i.e. a data value of "123,4567" will be shown as "123,46".
Query printout precision[edit]
A printout precision denoted in an #ask
query using -p<digit>
will override a possible predetermined precision via the property page set by the "Display precision of" special property.2
- Syntax
{{#ask: [[Category:City]] [[Has area::+]] |?Has area|+align=right |?Has area#-n-p2|+align=right |?Has area#m²-p3|+align=right |mainlabel=City }}
- Result
City | Has area | Has area | Has area |
---|---|---|---|
Amsterdam | 219.00 km²84.56 sqmi <br /> | 219.00 | 219.000 km²84.556 sqmi <br /> |
Berlin | 891.85 km²344.34 sqmi <br /> | 891.85 | 891.850 km²344.343 sqmi <br /> |
Cologne | 405.02 km²156.38 sqmi <br /> | 405.02 | 405.020 km²156.378 sqmi <br /> |
Frankfurt | 248.31 km²95.87 sqmi <br /> | 248.31 | 248.310 km²95.872 sqmi <br /> |
Karlsruhe | 173.46 km²66.97 sqmi <br /> | 173.46 | 173.460 km²66.973 sqmi <br /> |
London | 1,706.80 km²659.00 sqmi <br /> | 1706.80 | 1,706.800 km²658.995 sqmi <br /> |
Munich | 310.43 km²119.86 sqmi <br /> | 310.43 | 310.430 km²119.857 sqmi <br /> |
Paris | 105.40 km²40.69 sqmi <br /> | 105.40 | 105.400 km²40.695 sqmi <br /> |
Porto | 41.66 km²16.08 sqmi <br /> | 41.66 | 41.660 km²16.085 sqmi <br /> |
Rome | 1,285.31 km²496.26 sqmi <br /> | 1285.31 | 1,285.310 km²496.258 sqmi <br /> |
San Diego | 963.60 km²372.05 sqmi <br /> | 963.60 | 963.600 km²372.046 sqmi <br /> |
Stuttgart | 207.35 km²80.06 sqmi <br /> | 207.35 | 207.350 km²80.058 sqmi <br /> |
Sydney | 2,058.00 km²794.59 sqmi <br /> | 2058.00 | 2,058.000 km²794.594 sqmi <br /> |
Vienna | 414.87 km²160.18 sqmi <br /> 1,073,815,073.82 km²414,600,000.00 sqmi <br /> | 414.87 1073815073.82 | 414.870 km²160.181 sqmi <br /> 1,073,815,073.815 km²414,600,000.000 sqmi <br /> |
Warsaw | 516.90 km²199.58 sqmi <br /> | 516.90 | 516.900 km²199.575 sqmi <br /> |
Würzburg | 87.63 km²33.83 sqmi <br /> | 87.63 | 87.630 km²33.834 sqmi <br /> |
See also[edit]
- Help page on custom units
- Help page on displaying information
- Help page on display precision
- Help page on currency handling
References
- ^ Semantic MediaWiki: GitHub pull request gh:smw:1335
- ^ Semantic MediaWiki: Sandbox example for pull request 1335