Pune Budget Info Wiki
Register
Advertisement

The datatype Number is used for properties that contain any kind of number, whole numbers, decimal, and floating point numbers. It can be positive or negative, with thousand separators, and can have an optional exponent. For example, [[Psi beam:=4,297.31 e7]]

It allows for giving units after the number as well. Though Type:Number does not understand units (i.e. it performs no automatic conversion), a unit can be used to distinguish attribute values with different units. For example, [[Psi beam:=42 mindmelds]].

  • corresponds to::1
  • corresponds to::0.000001 million, mn, millions
  • corresponds to::0.000000001 billion, bn, billions
  • corresponds to::0.000000000001 trillion, tn, trillions
  • corresponds to::0.00001 lakhs, lac, lacs
  • corresponds to::0.000000001 crore, karod, crores
  • display units::million
  • display units::INR

Values[]

As of 9 pm Mar 14 CET, 2008 according to http://finance.google.com/finance

Exchange rate (value of 1 US Dollar) and allowed currency symbols Description
Corresponds to:=1 $, USD US Dollars
Corresponds to:=0.638 €, euro, EUR European Monetary Union
Corresponds to:=0.495 GBP, pounds United Kingdom British pound or pounds sterling
Corresponds to:=99.21 JPY,¥,¥ Japanese Yen
Corresponds to:=50 INR, Rs, Rupees Indian Rupee

Note that in SMW 0.5, the currency symbol must follow the amount.

TODO[]

Automatically regenerate the conversion rates in this page each day. http://www.newyorkfed.org/xml/schemas/FX_Utility.xsd lists various currency codes as enumerated values of CL_CURRENCY_UNIT.

Users need to know when the currency was converted and/or the date of the currency conversion factors. In the tooltip display of alternate currencies, we could show the date of the conversion, based on the date of last update:

(Currency conversions as of 2006-05-03)

If/when float values support prefixes, we can do $59.95 and £20.

Maybe there should be a way to overload the float value to specify a precision (e.g. 100 cents) and format.

Alternative approach[]

Use service links to provide a link in the factbox to an external currency conversion tool. Then currency properties can just be of Type:Number, which will remember the currency unit after the number but won't try to convert it, however the external currency conversion tool will perform the conversion. See Property:Monetary amount


You can also use or create your own datatype that is aware of units, see Custom units.

Type:Number is a universal replacement for the separate datatypes and Float used in earlier versions of Semantic MediaWiki. The Integer and Float datatypes are aliases for Type:Number in SMW 1.0.

Advertisement