Special property "Display precision of"

From semantic-mediawiki.org
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
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.


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

 [[Has area::+]]
 |?Has area|+align=right
 |?Has area#-n-p2|+align=right
 |?Has area#m²-p3|+align=right
CityHas areaHas areaHas area
Amsterdam219.00 km²84.56 sqmi
219.00219.000 km²84.556 sqmi
Berlin891.85 km²344.34 sqmi
891.85891.850 km²344.343 sqmi
Cologne405.02 km²156.38 sqmi
405.02405.020 km²156.378 sqmi
Frankfurt248.31 km²95.87 sqmi
248.31248.310 km²95.872 sqmi
Karlsruhe173.46 km²66.97 sqmi
173.46173.460 km²66.973 sqmi
London1,706.80 km²659.00 sqmi
1706.801,706.800 km²658.995 sqmi
Munich310.43 km²119.86 sqmi
310.43310.430 km²119.857 sqmi
Paris105.40 km²40.69 sqmi
105.40105.400 km²40.695 sqmi
Porto41.66 km²16.08 sqmi
41.6641.660 km²16.085 sqmi
Rome1,285.31 km²496.26 sqmi
1285.311,285.310 km²496.258 sqmi
San Diego963.60 km²372.05 sqmi
963.60963.600 km²372.046 sqmi
Stuttgart207.36 km²80.06 sqmi
207.36207.360 km²80.062 sqmi
Sydney2,058.00 km²794.59 sqmi
2058.002,058.000 km²794.594 sqmi
Vienna414.87 km²160.18 sqmi
414.87414.870 km²160.181 sqmi
Warsaw516.90 km²199.58 sqmi
516.90516.900 km²199.575 sqmi
Würzburg87.63 km²33.83 sqmi
87.6387.630 km²33.834 sqmi

See also[edit]


  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:1335
  2. ^  Semantic MediaWiki: Sandbox example for pull request 1335