History: Currency Amount Tracker Field
Preview of version: 9
Currency Amount Tracker Field
This field is used to display amounts in currency, using local currency symbols, three-letter international currency codes, or codes of your own making (for a community currency, for instance). Country conventions for decimals and separating thousands can also be set.
Options
Parameter | Value | Default | Description |
---|---|---|---|
amount | any decimal | 20.99 | the calculation of the amount |
sourceCurrency | 3-letter ISO 4217 currency code | CAD | source currency,which currency is the amount in?. The three-letter currency code for Amount |
exchangeRatesTrackerId | number | 50 | the currency field of the tracker |
samerow | 0 or 1 | 0 | Will display the next field or checkbox in the same row if set to 1 |
size | number of charcters | 17 | The visible size of the field in characters |
prepend | any text | none | Text that will be displayed before the field |
append | any text | none | Text that will be displayed just after the field |
locale | language_country code, for example en_US or en_US.UTF-8 or en_US.ISO-8559-1 | en_US | This language code (ISO 639) + country code (ISO 6339) determines how decimals are displayed and what thousands separator is used |
defaultCurrency | 3-letter ISO 4217 currency code | USD | The three-letter currency code that will display as convert currency |
symbol | i or n | n | Set to i for international symbol, n for local |
all_symbol | 0 or 1 | 0 | Set to 1 to show symbol for every item (default only shows currency symbol on first item in a list) |
Examples
locale set to fr_CA (language = French country = Canada) |
locale set to ja_JP (language = Japanese country = Japan) |
locale set to de_DE (Germany) symbol set to i all_symbol set to 1 |
Multi-currency
In Tiki19, this field was improved so it can track values in any currency, and on mouse-over, show the equivalent value in other currencies. This is very useful if you need to track items in many currencies. For example, you get paid in more than one currency, and you'd like to know the value in other currencies.
The exchange rates are stored in a tracker. You can set date ranges for exchange rates.
This field had a bunch of incremental fixes and enhancements in branch 20.x in September 2019, so if you intend to use seriously, you should probably get the Daily Build or from SVN.
Exchange rate example
Examples
{currency amount=20.99 sourceCurrency=CAD exchangeRatesTrackerId=50 prepend= append= locale=en_US.UTF-8 defaultCurrency=USD symbol=n allSymbol=0}
Tiki22
All currency fields now have another index field named permName_base. It contains a numeric value of the amount converted to base currency. Base currency is the currency with rate = 1 in the currency tracker. If you need multiple base currencies, you could use multiple currency trackers each having a different rate = 1 currency. Then, some currency fields will use one currency tracker and others will use the other one.
Sorting: use the "_base" suffix currency field in a LIST context and sort on that.