Wikifunctions:Type proposals/Currency
Use/Why
Currencies are used all across the modern world, and, should have a representation on Wikifunctions. They shouldn't be conflated with measurement units, since they behave slightly different from physical quantities.
Types
This proposal would create 2 types
Currency unit
This is the type of currency. It should just be a 3 letter string, with the currency's ISO-4217 code.
Currency measurement
This is the amount of a currency to represent. It should consist of a rational number and a Currency Unit.
Renderer
For Currency units, the full name should be rendered. For Currency measurements, the currency symbol and value should be displayed, in a language-specific manner. The value should be rendered as a decimal number with all the digits (for example, $26 should be rendered as "$26.00" in English).
Validator
The validator will make sure that a given unit is three letters, and is a valid active, historical, or non-standard ISO-4217 code.
Alternatives
- The currency unit could be displayed as the ISO-4217 code, or simply the symbol
- Instead of Currency unit, we could simply use Z6091
Comments
Support This could be very useful for uses like Wikifunctions:Project_chat#Inflation_calculator. Dv103 (talk) 12:56, 6 July 2025 (UTC)
- Why use the symbol instead of a more richly interconnected value like a QID? Clearly we will need a lookup function to convert between the two, but I would have thought that the primary unit should be a QID. Or maybe even a lightweight enum of all possible currency QIDs? --99of9 (talk) 07:07, 7 July 2025 (UTC)
- I agree that a Z6091 could work well. I'm instead not too convinced with the lightweight enum, since it would be a very huge enum (and I'm not so shure how well work huge enums), and the list af all the currencies could vary very often. Dv103 (talk) 09:09, 7 July 2025 (UTC)