Special property "Display precision of"

From semantic-mediawiki.org
Display precision of
Precision in digits
Further Information
Provided by: extension "Semantic MediaWiki "Semantic MediaWiki (SMW) is a free, open-source extension to MediaWiki that lets you store and query data within the wiki's pages. Semantic MediaWiki is also a full-fledged framework, in conjunction with many spinoff extensions, that can turn a wiki into a powerful and flexible knowledge management system. All data created within SMW can easily be published via the Semantic Web, allowing other systems to use this data seamlessly.
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

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

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

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
 |?Has area#-n-p2
 |?Has area#m²-p3
 |mainlabel=City
}}
Result
CityHas areaHas areaHas area
Amsterdam219.00 km²
84.56 sqmi
219.00219.000 km²
84.556 sqmi
Belleville60.00 km²
23.17 sqmi
60.0060.000 km²
23.166 sqmi
Berlin891.85 km²
344.34 sqmi
891.85891.850 km²
344.343 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
Warsaw516.90 km²
199.58 sqmi
516.90516.900 km²
199.575 sqmi

See also


References