Help:Type Number

The datatype number is used for properties that contain any kind of number, integer, decimal, and floating point numbers. It can be positive or negative, with thousand separators, and it can have an optional exponent. For example, "42", "-273.15" and "4,297.31 e7" are valid numbers. The permitted range of numbers can be restricted using.

Datatype Number is a universal replacement for the separate datatypes Float and Integer used in early versions of Semantic MediaWiki. Integer and Float are aliases for datatype Number since.

Units of measurements
It is possible to use units of measurement with number values. They can be specified as arbitrary non-numerical strings after the number. Though datatype Number does not understand units (i.e. it performs no automatic conversion), a unit can be used to distinguish property values with different units to avoid accidental comparison of quantities that have been given in different units. It is also possible to define a property that is aware of units. See the help page on custom units for further information on this.

Display precision
Since it is also possible to define the display precision for a property of datatype "Number". See the help page on display precision for further information on this.

In other languages
Numbers are written differently in different languages, and some of these differences are taken into account by Semantic MediaWiki. In particular, there is no global consensus on how to write the decimal separator ("." in English) and the thousands separators ("," in English). When using Semantic MediaWiki in a wiki that does not use English as a content language, the format for numbers might change according to the local customs. For example, German numbers use "," as a decimal separator and "." as a thousands separator, so German "1,234" is the same as English "1.234" not "1234".

Note that the thousands (kilo) separator is optional, and is used only for formatting in some languages where it is not needed for the input. For example, French numbers group thousands with spaces, which is allowed anyway, and thus their thousands separator is a non-breakable space even though this will rarely be typed by users when writing numbers.

In recent versions of SMW, both the decimal separator and the thousands separators are determined by the wiki language using MediaWikis i18n system. So you cannot change the symbols used yourself.

Displaying information in queries
There are several possibilities to display and format numerical information in printout statements to an inline query. See the help page on displaying information for further information.