Discuss Help:Datatype "Number"

From semantic-mediawiki.org

Please note Talk pages on this wiki should primarily be used to address possible mistakes as well as missing and superseded information in the documentation.

In case you are seeking support concerning individual questions, please have a look at this page.

The Semantic MediaWiki user mailing list is always a good idea for seeking help.

Enhancing this datatype

It would be nice with support for user inputs such as ½, ¼, etc as well, or in fact to be able to define such values per type! 23:39, 8 March 2011 (CET)

Disabling the separators

Could someone explain how to disable the kilo separators entirely? I'd like to be able to display the numbers without it. Removing all content from the separator page has no effect, it just uses the default separator. --John6354 12:08, 10 March 2011 (CET)

Same question from me. I'd really like to have the possibility the display my numbers without any seperator. Think of ICQ-UIN as example - seperators prevent them from being easy copy-pasted.

-- 09:34, 18 April 2011 (CEST)

Can you just use the #ISO format modifier when defining the property you want to display? (ie. '?MyProperty #ISO' instead of just '?MyProperty'). - Lbillett 17:51, 18 July 2012 (CEST)
No since #ISO is only available for datatype date. I case you want to get rid of the kiloseparator you have to blanc the system message MediaWiki:Smw kiloseparator. I have just successfully done this with inserting <!-- --> into the message. However this appears as a very dirty "hack" to me. Cheers --[[kgh]] 21:30, 18 July 2012 (CEST)
Yes, this is dirty and even not necessary. I just read the help page where it says that you just have to append # to the property name. This is the way to go, so please ignore my previous post. Cheers --[[kgh]] 21:33, 18 July 2012 (CEST)

Need leading zero for decimal points?

When entering a property of type number with say, '.54' the property appears to get set as '54'. Is there a way to have the entry interpreted as '0.54'? I have a lot of different people filling out a semantic form and this has been a bit of a problem. - Lbillett 17:47, 18 July 2012 (CEST)

I am afraid that currently only way from preventing this to happen is to increase input accuracy by adding an note with the #info parser function. However I have filed Task T40476 to address this issue. Cheers --[[kgh]] 21:09, 18 July 2012 (CEST)

Formatting numbers

Is there anyway to change the way numbers are formated? I have a "Property:Zip Code" that I would like to have displayed without a comma (12345 instead of 12,345). I know that I could simply use a string but I want to be able to perform numerical operations on the property and had it sorted numerically, not alphabetically. Thanks in advance for any help! --Zackmann08 (talk) 20:23, 10 August 2012 (CEST)

Doesn't this help in you case? Other means of formatting a number are provided by the NumberFormat extension. Cheers --[[kgh]] (talk) 23:34, 10 August 2012 (CEST)


Thread titleRepliesLast modified
Is any part of the data type declaration case-sensitive?110:22, 31 January 2015
Number precision110:17, 31 January 2015

Is any part of the data type declaration case-sensitive?

I'm having problems on one of my wikis, where using
[[has Type::Number]]
or variations still causes numbers to show links to internal pages (which don't exist). Is "has", "type", or "number" case-sensitive?
Feuertier (talk)19:25, 10 December 2014

"has Type" is not a valid declaration but "Has type" is, see also Special property "Has type" and Help:Property declaration.

mwjames (talk)10:22, 31 January 2015

Number precision

Is it possible to increase the precision for a property that has type Number?

Tommyheyser (talk)01:53, 31 January 2015

Just to clarify the definition of precision, if a property value is declared by [[Has number::123.45]] then the number 123.45 has a precision of 5 and a scale of 2.

What is the exact use case for increasing the precision and where does SMW currently limit the use of a precision?

mwjames (talk)10:17, 31 January 2015