Template talk:Exchange rates

From Wikivoyage
Jump to navigation Jump to search

Original source[edit]

This article contains content imported from the English Wikipedia article on Template:Exchange rate. View the page revision history for a list of the authors.

This is the version used: [1] Ground Zero (talk) 22:30, 2 January 2017 (UTC)Reply[reply]

Discussion about this template[edit]

See Pub#Currencies, again. -- Ryan • (talk) • 22:53, 4 January 2017 (UTC)Reply[reply]

Other currencies[edit]

  • I have added Chinese yuan as it is relevant in places like Mongolia, North Korea, Hong Kong, Macau. Ground Zero (talk) 12:41, 9 January 2017 (UTC)Reply[reply]
But I seem to be having syntax problems - see South Korea, for example. @Wrh2: - any suggestions? Ground Zero (talk) 13:53, 9 January 2017 (UTC)Reply[reply]
There was a missing "}}". It should be fixed now. -- Ryan • (talk) • 15:08, 9 January 2017 (UTC)Reply[reply]
  • I have added Australian $ to some southeast Asian countries, and Indian rupees as it is relevant in places like Sri Lanka, Nepal, Bangladesh, Maldives and Bhutan. Editors can add other currencies as they see fit. Ground Zero (talk) 14:59, 11 January 2017 (UTC)Reply[reply]

Daily updated rates[edit]

Hi, I just wanted to inform that rates on fr:Module:Prix/Data are daily updated by bot, this could be used to automaticaly update this template. --Adehertogh (talk) 16:44, 20 February 2017 (UTC)Reply[reply]

@Adehertogh: where can I find some documentation on how to call this function? --Traveler100 (talk) 11:15, 6 May 2017 (UTC)Reply[reply]
Hi, I still haven't write any documentation. The function is used now only by fr:Module:Prix which is used by fr:Template:Prix and the database is updated daily by BOT-Superzerocool. To use it you should have to write a specific script. fr:Module:Prix use the gadgets to change the reference currency. The gadget ReferenceEUR is by default. --Adehertogh (talk) 05:42, 11 May 2017 (UTC)Reply[reply]
Hello Adehertogh, similar functionality has been introduced here with Module:Exchangerate using data from c:Data:ECB euro foreign exchange reference rates.tab and soon from c:Data:Xe.com exchange rates.tab. The data on fr:Module:Prix/Data isn't accessible from here I'm afraid. But it seems that submodule has rates for more currencies, but the bot of Superzerocool has apparently stopped walking. But do you happen what the source for that data was? Thanks in advance, --Marsupium (talk) 23:33, 27 March 2022 (UTC)Reply[reply]
Hi, I just restarted the bot. About the source, it comes from free.currencyconverterapi.com and it refresh the information once daily. The script is pretty easy to read (if you understand python :P) here. I prefer to centralize all currency into one place, so, I recommend migrate to Commons data, because it's more stable and centralizated than my script. Anyways, if you prefer, I can continue running bot. Regards Superzerocool (talk) 15:06, 28 March 2022 (UTC)Reply[reply]
@Superzerocool: The link you gave to Github answers 404. No big deal for me, I was just going to take a quick look, but somebody else might need it for real work. –LPfi (talk) 16:29, 28 March 2022 (UTC)Reply[reply]
@LPfi: Oops, private repo. I'll strip some keys and other stuff before make it public. Superzerocool (talk) 19:42, 28 March 2022 (UTC)Reply[reply]
Hi Superzerocool, thanks for the reply and thanks for restarting the bot! Indeed I think it is a good idea to keep the data centrally at Commons. Would it possible to let the bot update a tabular data file at Commons? (If nothing speaks against it preferably in the format of the files c:Data:ECB euro foreign exchange reference rates.tab and c:Data:Xe.com exchange rates.tab?) They are already evaluated by Module:Exchangerate. But fr:Module:Prix/Data has more exchange rates not present in them. Once the data gets updated regularly on Commons it shouldn't be too difficult to make fr:Module:Prix use it so that the local fr:Module:Prix/Data gets dispensable.
And BTW, is there any progress on making bot-rates.py public? Thanks a lot for everything, best, --Marsupium (talk) 00:43, 16 April 2022 (UTC)Reply[reply]
Hu @Marsupium, sorry for this delay to answer. I just uploaded a "key-less" version of script. I see it and I think "It's an older version of my job", because I coded it when I started to leran python. Kindly Superzerocool (talk) 14:33, 13 May 2022 (UTC)Reply[reply]

Precision of exchange rates[edit]

Discussion moved from User_talk:Ground Zero

Hi there.

I noticed that you removed the two decimals from the exchange rates in Taiwan. I personally feel at unease when I see such rounded exchange rates. Are travellers too stupid to handle at least one decimal? I do not think so. Of course at the end, we are all using rounded numbers in our heads when travelling a country. However, no reliable source quotes rounded exchange rates except for doggy hotels that try to con its guests.

Hence, for the purpose of trustworthiness and consistency could we stick with at least one decimal on WV? What do you think?

Many thanks ... Ceever (talk) 01:04, 27 January 2018 (UTC)Reply[reply]

The problem is that exchange rates change and an overly exact rate may well be different the next day... Hobbitschuster (talk) 01:28, 27 January 2018 (UTC)Reply[reply]
One decimal point makes sense for conversions like £1=Cdn$1.7, but less so for US$1=NT$29.4, and not at all for US$1=553.7 CFA franc.
I'm an economist and have dealt with numbers all my life, but I don't think there is a substantive difference for travellers between NT$29.4 and NT$29. I have also found that the large majority of travellers are not that precise when making conversions.
Finally, we round the date of the conversion to the nearest month. Almost all of the exchange rates I updated at the beginning of this month are now out of date. US$1 does not equal NT$29.4 today. It equals $29.1. So being overly precise is not useful, and it is misleading.
Finally, in the case of Taiwan, only the US dollar was converted to two decimal points. The euro and the UK pound were expressed as whole numbers, which looked stupid.
I agree with you that we should have a policy on this, but I don't know what that would look like given the wide range of currency values around the world (US$1=36,775 Iranian rials, and so on). Ground Zero (talk) 01:38, 27 January 2018 (UTC)Reply[reply]
@Ceever: @Hobbitschuster: What about this: "use 2 non-zero digits, e.g., US$1 = 37,000 Iranian rials or 550 CFA francs, or NT$29, or £0.71"? This should be discussed on a policy talk page, but I thought I'd bounce the idea off the two of you first. Regards, Ground Zero (talk) 02:03, 27 January 2018 (UTC)Reply[reply]
I think this sounds like a good idea, though it might need to be phrased carefully. If US$1 = 4,016 Lilliputian francs, for instance, I think it would make the most sense to give the number "4,000", even though that only has one non-zero digit. —Granger (talk · contribs) 02:10, 27 January 2018 (UTC)Reply[reply]
Quite right. Something like "use 1 or 2 non-zero digits, e.g., US$1 = 37,000 Iranian rials or 550 CFA francs, or NT$29, or €0.80, or £0.71". Ground Zero (talk) 02:16, 27 January 2018 (UTC)Reply[reply]
I think fixed and pegged exchange rates should always be given as exactly as the peg is defined. And yes that includes 1.95583 for the Bosnian convertible Mark. Hobbitschuster (talk) 03:43, 27 January 2018 (UTC)Reply[reply]
Out of every 1000 travellers who look up exchange rates for the Bosnian convertible mark, how many would use 1.95583 for their conversions, and how many would say, "well, that's close enough to 2:1, so I'll just halve all the prices to get euros"? I would bet that close to 1000 who choose the scond option.
The conversions in the exchange rate boxes should be useful to travellers in reading our articles, i.e. so they can do quick and rough conversions. They should not be used for business or financial purposes because they are always out of date. They are only approximations, and that is why we use the symbol instead of =.
I think we should put the rounded number in the box, and provide the exact number, for whatever it is worth, in the accompanying text. @Ceever:, @Hobbitschuster:, @Mx. Granger: Ground Zero (talk) 23:33, 27 January 2018 (UTC)Reply[reply]
In cases of fixed exchange rates, I think that makes sense—put the rounded number in the box and the exact number in the text. —Granger (talk · contribs) 23:49, 27 January 2018 (UTC)Reply[reply]

Proposal[edit]

Based on the discussion above, I propose to add to the "Notes on template use":

"To make it easy for travellers to do conversions when reading this guide, we provide approximate exchange rates. When updating the exchange rates in the template, use 1 or 2 non-zero digits, e.g., US$1 ≈ 37,000 Iranian rials or 550 CFA francs, or NT$29, or €0.80, or £0.71". If the currency is fixed or pegged to another currency, then show the approximate exchange rate in the template, and the precise exchange rate in the accompanying text."

I'm going to be offline for at least a week, so talk amongst yourselves. Ground Zero (talk) 00:39, 28 January 2018 (UTC)Reply[reply]

The problem is that we claim to understand what is best for the traveller. However, each traveller is different, some might be fine with rounded numbers and some might not. And as I have told you, I am at unease with such rounded exchange rates. The only solution would therefore be to cover those traveller which are on this side of the extreme because everyone else does not really care about the decimals anyhow, so they wouldn't mind an extra number.
Furthermore, as I have initially clarified, my point was never what is reasonable in sense usability. I full understand that 29.5 does not make a difference to 29. My point was the underlying statement that is delivered by rounded numbers and the inconsistency to other source that quote exchange rates. But this central argument was never considered here.
Therefore, as a compromise hopefully, I would like to make the following proposal:
  • 0–9.99: 2 decimals
  • 10–99.9: 1 decimal
  • 100–...: 0 decimals
  • pegged: all decimals with a note of the reason, namely "pegged"
Cheers, Ceever (talk) 13:10, 29 January 2018 (UTC)Reply[reply]
I think we really should not be using three significant figures for non-fixed exchange rates. We aren't realistically going to be able to keep exchange rates up to date with that level of precision, so giving a number like "31.1" or "8.56" is just misleading our readers with false precision. Any travellers who need that level of precision should look to a more up-to-date source, and we are doing a disservice to those travellers if we make our exchange rates look so much more precise than they will realistically be. —Granger (talk · contribs) 13:40, 29 January 2018 (UTC)Reply[reply]
  • Well, they are neither up to date if rounded.
  • Also, there is a date stating when the rate is from. If I look into the LP, I also do not see up to date rates. Why would I expect on WV?
  • Furthermore, I am not saying that you have to update them so often. All information here is "out of date". Why the commitment to keep exchange rates updated that urgently?
  • Either way, you would still also have to check whether the rounded number is still up to date from time to time. So the amount of work would not be much more.
  • Last but not least, we are making a decision for the traveller here instead of leaving the decision with him. He got all the information there, how can this be a disservice?
  • As mentioned, this way we keep up trustworthiness and consistency.
Cheers, Ceever (talk) 14:03, 29 January 2018 (UTC)Reply[reply]
Editing is about making choices for the reader, so that is not a problem. The real question is what we are trying to do by the template. If the point is giving a rough estimate, so that the traveller can plan their budget and tell what places are affordable, then I think two significant numbers (which is what counts, not the number of decimals) are enough. If we want to give enough precision that travellers can deem whether an offered rate is good, then we need precision, and then we need that precision to count on the moment it is used.
The whole point in calculating significant figures is that you show how much information is both relevant and trustworthy. Anything the reader will not use or need, or that has changed since last update, is just ornaments or noise (in the technical sense), and keeping the noise level down is good editorial practice. Sure, the first figure may change from time to time, but the third figure will change often, and will do so without there being headlines about it.
--LPfi (talk) 14:37, 29 January 2018 (UTC)Reply[reply]
Ceever, we do not show the date for exchange rates. We shoe the month. Including the month tells the reader how recent the information is, and editors whether it should be updated. If I see a rate from 2012, then I am prompted to update it. Without that info, I don't know whether it was updated last week or six years ago.
Showing the month makes us better than LP. The LP site says that US$1=NT$31.98. We know that's wrong, but the reader doesn't unless they know the current rate, and then they don't need LP's out-of-date information.
Our exchange rate box should only be used for general guidance. Someone who wants an up-to-date or precise rate really must click through the link provided in the box to the external website (until we can figure out how to provide live updates).
The NT$ exchange rate varied widely throughout January, so we should not imply false precision. Ground Zero (talk) 02:52, 5 February 2018 (UTC)Reply[reply]

I expect that Ceever is not onside with this, but otherwise, is it fair to say that there is a consensus to implement the proposal at the top of this section? Ground Zero (talk) 11:52, 14 February 2018 (UTC)Reply[reply]

Sorry, do not agree. My proposal still stands as well. Ceever (talk) 23:38, 17 February 2018 (UTC)Reply[reply]
I understand that you support your proposal, but it looks to me like the rest of those who have joined the discussion support the proposal at the top of the section. (They should correct me if I'm wrong.) @Hobbitschuster: @LPfi: @Mx. Granger: Ground Zero (talk) 00:28, 18 February 2018 (UTC)Reply[reply]
To be completely clear: I support Ground Zero's proposal at the top of this section. —Granger (talk · contribs) 12:08, 18 February 2018 (UTC)Reply[reply]
I do not particularly like the wording (especially "one or two non-zero digits", which does not catch the reasoning), but common sense is enough to interpret it sensibly and I cannot come up with anything better at the moment. I think three significant figures are seldom useful and never important (in this context), while they can be severely misleading with less stable exchange rates. --LPfi (talk) 13:01, 18 February 2018 (UTC)Reply[reply]
Hm. That's what I was trying to convey with "To make it easy for travellers to do conversions when reading this guide, we provide approximate exchange rates." I'm open to better wording though. Would you want to add the counter example, e.g.,
"When updating the exchange rates in the template, use 1 or 2 non-zero digits, e.g., US$1 ≈ 37,000 Iranian rials or 550 CFA francs, or NT$29, or €0.80, or £0.71. Using more digits, e.g., US$1 ≈ 37,800 Iranian rials, makes it harder for readers to do conversions without a calculator, and suggests greater accuracy than Wikivoyage can provide without frequent updating."
Ground Zero (talk) 13:36, 18 February 2018 (UTC)Reply[reply]

The template does not comply with the decided currency denotation[edit]

See Croatia#Buy for example.

Can this be corrected?

Cheers, Ceever (talk) 01:39, 29 April 2018 (UTC)Reply[reply]

I'm not clear what the issue is. Can you explain? Ground Zero (talk) 02:55, 29 April 2018 (UTC)Reply[reply]
The currency denotation for Croatia is 100 Kn not kn100 which the template display. Ceever (talk) 04:39, 29 April 2018 (UTC)Reply[reply]
Ah, I see. I don't know how to fix that. Ground Zero (talk) 11:27, 29 April 2018 (UTC)Reply[reply]
The order is hard coded. One could introduce a new parameter stating the order and having every line be an if-statement choosing the right order. I think a cleaner solution is to instead have a second template for currencies with the code after the figure. Instead of adding a parameter one should then simply use the other template. --LPfi (talk) 05:48, 30 April 2018 (UTC)Reply[reply]
How about this:
{{exchange rates/sandbox
| currency=Croatian kuna
| currencyCode=Bs. 
| currencyCodeAfter= kn
| date=January 2018
| USD=6.2
| EUR=7.5
| GBP=8.4
| source=[http://www.xe.com/currency/hrk-croatian-kuna XE.com]
}}

Exchange rates for Croatian kuna (Bs.  kn)

As of January 2018:

  • US$1 ≈ Bs. 6.2 kn
  • €1 ≈ Bs. 7.5 kn
  • UK£1 ≈ Bs. 8.4 kn


Exchange rates fluctuate. Current rates for these and other currencies are available from XE.com

To get the space before the currency code you need to state as currencyCodeAfter= kn

Should I make make this live (currently in sandbox). --Traveler100 (talk) 09:16, 30 April 2018 (UTC)Reply[reply]

That looks great. Thank you, Traveler100. Ground Zero (talk) 10:54, 30 April 2018 (UTC)Reply[reply]
Nice. And it also covers the cases like "Bs. 100", where there needs to be a space—see example. Maybe in the heading the brackets should be removed to not have the weird space in there, like: Exchange rates for Croatian kuna: kn. Or just remove currencyCode from the heading and lets just title it right under currency, like: currency=Exchange rates for Croatian kuna (kn). Fine to go online. Thanks. Ceever (talk) 13:35, 30 April 2018 (UTC)Reply[reply]

Why space instead of comma[edit]

Is there a reason why the actual amounts in the filled templates use space instead of comma for separating thousands (or what it is called?

I thought the policy on WV was to use comma, like 1,000 kn instead of 1 000 kn.

Cheers Ceever (talk) 23:50, 1 May 2018 (UTC)Reply[reply]

At Wikivoyage:Currency#Formatting it says comma, not space. No exceptions are mentioned. --FredTC (talk) 11:33, 3 May 2018 (UTC)Reply[reply]
Dito. @Ground Zero: Could you take this into account in the future when changing the rates? I will adjust the ones that are out of order as of now. Cheers, Ceever (talk) 12:07, 3 May 2018 (UTC)Reply[reply]
I will. Ground Zero (talk) 17:29, 13 May 2018 (UTC)Reply[reply]

Exchange Rates are wrong[edit]

Swept in from the pub

Hi WikiVoyage, I've noticed that on a number of European pages, the exchange rate seems to be mixing up the USD, EUR and GBP symbols, resulting in nonsensical exchange rates. For instance, on the Spain Money section, it shows that 1.1 EUR = 1 EUR, which is obviously incorrect. I assume this probably happened during the FX refresh that seems to happen every January. Not sure if there is a bot or something that can update quickly, otherwise it will be quite the task to get all the pages updated. --unsigned comment by User:148.252.128.54

That was my mistake. Thanks for pointing it out. I have fixed it now. This uses a template, so correcting it there applies the change to all articles that use the temple. Ground Zero (talk) 13:58, 18 January 2022 (UTC)Reply[reply]
Thanks! JackHahne (talk) 10:42, 24 January 2022 (UTC)Reply[reply]

Bug in Exchangerate templates[edit]

Swept in from the pub

I've noticed that a possibly serious bug is lurking in the Exchangerate template; as shown in the Template:Exchangerate page:

{{USD|2}} will give you : <abbr title="US$2 ≈ €1.762892, JP¥Expression error: Unrecognized punctuation character "["., £Expression error: Unrecognized punctuation character "[".">$2

I would assume that the more technically minded users here would know how to fix this. --Dialh (talk) 07:10, 20 January 2022 (UTC)Reply[reply]

These were created by Traveler100 (talk · contribs) who's last edit was on 2020/01/25, a little less than two years ago. @Andyrom75:, any idea how to fix this? My template skills aren't as good to fix this error. SHB2000 (talk | contribs | meta.wikimedia) 07:21, 20 January 2022 (UTC)Reply[reply]
I've noticed that {{EUR}} seems to be working fine. SHB2000 (talk | contribs | meta.wikimedia) 07:28, 20 January 2022 (UTC)Reply[reply]
I did some digging, and this category as a list of pages with this problem. All I would do is abandon these templates. SHB2000 (talk | contribs | meta.wikimedia) 07:33, 20 January 2022 (UTC)Reply[reply]
Dialh, SHB2000, sorry it was because of my fault. Yesterday I've fixed an issue on the module but evidently I've introduced another one :-)
Now I've fixed it and ASAP I'll change all the templates that use that module to better manage all the cases where an editor gives a wrong input for such templates. --Andyrom75 (talk) 09:12, 20 January 2022 (UTC)Reply[reply]

[edit]

Please, make the template replacing ≈ with = when value ends with «(pegged)». 217.117.125.83 16:34, 21 April 2022 (UTC)Reply[reply]

That would be ideal, but it makes the template code much more complicated, especially as it is written now. The "≈" is hard-coded for each currency and would need to be replaced with a if-then-else construct with a string comparison expression. The template syntax support for functions is awkward, so one should probably do it inline. I think the "(fixed)" or "(pegged)" is probably clear enough for this to be a purely aesthetic issue. –LPfi (talk) 17:31, 21 April 2022 (UTC)Reply[reply]

List of currencies[edit]

Swept in from the pub

Can someone please point me to where the list of currencies recognised by the currency exchange module is maintained? I was thinking that including the exchange rate for Vietnamese dong will be useful for the Laos and Cambodia articles, since many people pass though them on overland journeys between Thailand and Vietnam. The dog2 (talk) 17:49, 16 March 2022 (UTC)Reply[reply]

Is Template:Exchangerate/list what you are searching for? I found it via {{EUR/doc}} –LPfi (talk) 08:48, 17 March 2022 (UTC)Reply[reply]
(edit conflict) @The dog2 is it Template:Exchange rates that you're referring to? It does not have a Vietnamese dong parameter, but it can easily be done. SHB2000 (talk | contribs | meta.wikimedia) 08:50, 17 March 2022 (UTC)Reply[reply]
@SHB2000: Ah yes, it's that one. I guess we could add the conversion rate of 10,000 Vietnamese dong to other currencies. The dog2 (talk) 18:41, 17 March 2022 (UTC)Reply[reply]
@The dog2 Yes Done. SHB2000 (talk | contribs | meta.wikimedia) 23:42, 18 March 2022 (UTC)Reply[reply]

Adding new currency[edit]

Hello, i'd like to add Indonesian Rupiah currency & exchange rate as there are lots of traffic from/to Singapore and Malaysia (also East Timor and Brunei Darussalam to an extent). But.. i don't know where to start. Veracious (talk) 06:58, 26 August 2022 (UTC)Reply[reply]