Template talk:ToUSDvalues
From Wikipedia, the free encyclopedia
Hello. This is just a helper-template for the {{toUSD}} template, which you can find here. Bladestorm 22:36, 14 February 2007 (UTC)
Contents |
[edit] Sources
Maybe put in the template common sources for the exchange rate info. I used x-rates.com but I'm sure there is something better/more readable. Cmsjustin 21:15, 15 February 2007 (UTC)
- You know what? That's a dandy idea!
- I use this. Just click the "Generate Currency Table!" button, and find the values under the "USD per Unit" column.
- (It's fine to just list it here, right? Or should it be added on the template page, nowiki'd, also?) Bladestorm 23:19, 15 February 2007 (UTC)
- That table works great. I wonder if someone could write a bot to do this automatically somehow. I don't know how often it would be updated, you know, by a human. Cmsjustin 21:22, 16 February 2007 (UTC)
- Direct link for future reference http://www.xe.com/ict/?historical=false&basecur=USD&sort_by=code —cmsJustin (talk|contribs) 23:37, 9 March 2007 (UTC)
- Free RSS feed for future reference. 1/x=usable number. http://www.currencysource.com/RSS/USD.xml —cmsJustin (talk|contribs) 20:05, 12 March 2007 (UTC)
- Direct link for future reference http://www.xe.com/ict/?historical=false&basecur=USD&sort_by=code —cmsJustin (talk|contribs) 23:37, 9 March 2007 (UTC)
- That table works great. I wonder if someone could write a bot to do this automatically somehow. I don't know how often it would be updated, you know, by a human. Cmsjustin 21:22, 16 February 2007 (UTC)
[edit] Adding other currencies
By the way, if anyone should wish to add more currencies, other than those currently in the table, you're, of course, more than welcome to do so. I would only request (and that's all it is, a request):
- You use the Currency Code for the currency you're using. (eg. CAD for canadian dollar, not CDN)
- You leave USD, EUR, and GBP at the top of the list. (I'm canadian myself, but even I know those are the three most significant currencies for anything the template is likely to be used for)
- After those three currencies, that everything else be sorted alphabetically by currency code.
- That no currency is listed twice. (eg. No listing CAD and CDN) This shouldn't be a problem if only proper currency codes are used.
Again, it's only a request. It's in the general domain now, so it isn't my template. Bladestorm 23:24, 15 February 2007 (UTC)
- My most recent edit keeps them in alphabetical order by country code. If I make a bot I will put them at the top. —cmsJustin (talk|contribs) 00:39, 10 March 2007 (UTC)
[edit] Semi-automated process for updating values
- Go to http://www.xe.com/ict/?historical=false&basecur=USD&sort_by=code and copy only the rows of the table with information.
- Paste into Microsoft Excel as HTML, remove all formatting from the cells and turn off word wrap
- Insert some columns and create some placeholders, maybe call them COL1, COL3, COL5, COL7, so now a row should look like this:
COL1 AED COL3 0.272338571 COL5 United Arab Emirates Dirhams COL7 - Save this as a tab-delimited text file and open it up in a text editor with a replace function (I used notepad)
- Replace COL1 with |, COL3 with =, COL5 with <! --, and COL7 with -->, so now your lines will look like this:
You may need to adjust your replaces with spaces to match what is in the template now. I used tabs before the "<! --". Speaking of that, there is no space between the "!" and the "-", I just put it there because it will comment it out if I don't.| AED=0.272338571 <! -- United Arab Emirates Dirhams -->
I'm trying to automate this process but it is proving difficult. I'm trying to find a free source for the values with a data feed and make a bot to update them daily. —cmsJustin (talk|contribs) 00:37, 10 March 2007 (UTC)
- I noticed Excel rounded some numbers, I'll be careful to set the number format next time. —cmsJustin (talk|contribs) 02:51, 10 March 2007 (UTC)
- Wow. Somebody's been busy, eh? :)
- BTW, if you want to be able to write markup tags without having them actually treated as html tags (eg. to show commenting without it really being turned into commenting), then you can put it between 'nowiki' tags. See: <!--Note that this isn't actually commented.--> (just 'edit' this comment to see what I mean by 'nowiki' tags) Bladestorm 17:45, 12 March 2007 (UTC)
[edit] Serbian Dinar
I noticed this was added recently, but I don't see it any of the data feeds listed above. Is it possible it is listed under a different name? It seems to track Pakistan Rupees maybe? —cmsJustin (talk|contribs) 12:49, 26 March 2007 (UTC)
- I moved it to the bottom if the list and used Google to update the info (Google RSD in USD) —cmsJustin (talk|contribs) 22:12, 28 March 2007 (UTC)
[edit] Automated script
I'm testing a new script that uses Google's currency conversion to obtain values. Right now about 80% of the older currency codes we were using are supported. Let me know if anyone notices any important ones missing (meaning a page that uses this is no longer functioning due to a missing value). The script link is on my userpage. —cmsJustin (talk|contribs) 00:52, 29 March 2007 (UTC)
[edit] Descriptions
Hexagon, diff I noticed this change you made. I am currently running a script that automatically updates the values, and it uses a list of predetermined currencies and descriptions. That file is kept here: User:Cmsjustin/ISO4217.txt. I updated it to show Polish Zloty. Feel free to make any updates to this file and I will check for changes before each run. Currently it uses Google for conversions, so if you decide to add a new currency make sure Google will accept it first. Also check out User:Cmsjustin for the entire script and User talk:Cmsjustin if you want to comment on it. Thanks! —cmsJustin (talk|contribs) 12:02, 6 April 2007 (UTC)
- Ooh ooh ooh! I wanna comment! I wanna comment! *ahem*
- Ya done good. :D
- (Wait, do I have to go to your talk page to say that? Because I'm pretty lazy) Bladestorm 13:43, 6 April 2007 (UTC)
- Whoopsie, I should start reading template desc's, huh? :) In any case, this template should not be kept dependant on an external file, especially one in the userspace. It could be moved to /codes or something like that. The script you run should also be written here, probably in the noinclude section. +Hexagon1 (t) 09:24, 8 April 2007 (UTC)
- It's not dependent on that file, thats just the file I use when the script runs. The template would exist without the script, it just wouldn't be updated as often or as thoroughly. —cmsJustin (talk|contribs) 12:05, 9 April 2007 (UTC)
- Which means it would be in the public interest to relocate the file and the script to template space. Userspace is much more volatile then templatespace, any number of things could happen that would render this vital template impossible to maintain. +Hexagon1 (t) 04:07, 11 April 2007 (UTC)
- Well, I think you're overstating it just a little bit. Before I saw that cmjustin was doing a far better job than I, I was doing it manually, and it only took about... 2 minutes? And, even then, that was just because I get distracted waaay too easily. :) Personally, I'm somewhat against putting such scripts into the main namespace, simply because they have no actual use there. Or, am I misunderstanding something? It's only included at all so we know how you're doing it, right? Bladestorm 06:15, 11 April 2007 (UTC)
- Technically, the script is a bot, and bots are usually kept in the userspace. See WP:BOT. I am running it manually right now because it doesn't have bot approval, I want to make sure its working right, and it isn't really done yet. Once I can get it fully automated, I intend on moving it to User:CmsJustinBot. —cmsJustin (talk|contribs) 12:05, 11 April 2007 (UTC)
- Bladestorm: I'm not questioning cmsJustin's ability to control the script, rather I'm saying that the code it uses should be hosted here under a subpage. Also templatespace != main namespace. And cmsJustin, that's also a good idea, but I think it's more of a script then bot. But it's your call, what I said above qualifies as a recommendation. +Hexagon1 (t) 05:13, 14 April 2007 (UTC)
- Technically, the script is a bot, and bots are usually kept in the userspace. See WP:BOT. I am running it manually right now because it doesn't have bot approval, I want to make sure its working right, and it isn't really done yet. Once I can get it fully automated, I intend on moving it to User:CmsJustinBot. —cmsJustin (talk|contribs) 12:05, 11 April 2007 (UTC)
- Well, I think you're overstating it just a little bit. Before I saw that cmjustin was doing a far better job than I, I was doing it manually, and it only took about... 2 minutes? And, even then, that was just because I get distracted waaay too easily. :) Personally, I'm somewhat against putting such scripts into the main namespace, simply because they have no actual use there. Or, am I misunderstanding something? It's only included at all so we know how you're doing it, right? Bladestorm 06:15, 11 April 2007 (UTC)
- Which means it would be in the public interest to relocate the file and the script to template space. Userspace is much more volatile then templatespace, any number of things could happen that would render this vital template impossible to maintain. +Hexagon1 (t) 04:07, 11 April 2007 (UTC)
- It's not dependent on that file, thats just the file I use when the script runs. The template would exist without the script, it just wouldn't be updated as often or as thoroughly. —cmsJustin (talk|contribs) 12:05, 9 April 2007 (UTC)
- Whoopsie, I should start reading template desc's, huh? :) In any case, this template should not be kept dependant on an external file, especially one in the userspace. It could be moved to /codes or something like that. The script you run should also be written here, probably in the noinclude section. +Hexagon1 (t) 09:24, 8 April 2007 (UTC)
[edit] Vacation
I'm gone for most of June, so someone else needs to hook it up. —cmsJustin (talk|contribs) 16:05, 27 May 2007 (UTC)

